This function generates data (X,y) with specified correlation and noise standard deviation.
Generate_data(truth.beta, p, n, truth.sigma, rho, correlation = c("block", "all"),
NumOfBlock)A vector of active beta's (s x 1, with s being the number of active coordinates).
The number of covariates.
The number of observations.
Noise standard deviation.
Correlation Coefficient.
Correlation structure. Correlation = "block" means predictors are grouped into equi-size blocks where each block contains one active predictor, and the within-block correlation coefficient is rho; predictors in different blocks are mutually independent. Correlation = "all" means all predictors are equi-correlated with coefficient rho.
Number of blocks, used only when correlation = 'block'.
A list, including vector 'y' (n x 1), matrix 'X' (n x p), vector 'beta' (p x 1).