True beta values are generated from p*r independent draws from N(0, 1/p) distribution. X are n independent draws from p multivariate normal N(0, SigmaX). Y is then generated using X and true beta values with an iid error term that follows r multivariate normal distribution N(0, Sigma).
data_gen(n, p, r = 1, sparsity = 0.5, Sigma = c("tridiag", "dense", "denseQR", "compound"), s = NULL, SigmaX = c("tridiag", "dense", "denseQR", "compound"), sx = NULL, ...)
n | desired sample size |
---|---|
p | desired dimension |
r | number of responses |
sparsity | desired sparsity for beta |
Sigma | covariance matrix structure used to generate Y | X |
s | option to specify diagonal elements in Sigma |
SigmaX | covariance matrix structure used to generate data X |
sx | option to specify diagonal elements in SigmaX |
... | additional arguments to pass to data generating functions |
Y, X, betas, Sigma, SigmaX
# generate 100 observations with predictor dimension equal to 10 and response dimension equal to 5 data = data_gen(n = 100, p = 10, r = 5)