Skip to contents

Generate synthetic sparse regression data.

Usage

generate_regression_data(
  n = 100,
  p = 500,
  a = 5,
  b = 1,
  sparsity = 0.05,
  coeff_size = 1
)

Arguments

n

Number of data points

p

Dimensionality

a

Correlations are sampled as Beta(a,b) random variables.

b

Correlations are sampled as Beta(a,b) random variables.

sparsity

Proportion of nonzero coefficients.

coeff_size

Size of coefficients