Simulates data from a regression model and computes the lasso estimate for this data.
simLASSO(lambda, X, beta, sigma, penalize, rescale.lambda = TRUE, ind = 1)
Penalty factor to be applied
Design matrix of regression problem
true value of parameter vector to simulate from
true value of square root of variance parameter for simulating.
Vector giving penalty structure. Supplied to glmnet as `penalty.factor
'. By default, all coefficients except first are penalized.
Should lambda be rescaled to account for the default re-scaling done by glmnet?
Index of coefficient to be returned. Value of 0 implies all coefficients (i.e. the full parameter vector estimate)
Simulates data from a regression model with true
coefficient parameter beta
and normal errors with
standard deviation sigma
. Computes the LASSO
estimate for the coefficient vector using the glmnet
function from the package of the same name.