simLASSO {eshrink}R Documentation

Compute Lasso Estimator for simulated Data

Description

Simulates data from a regression model and computes the lasso estimate for this data.

Usage

simLASSO(lambda, X, beta, sigma, penalize, rescale.lambda = TRUE, ind = 1)

Arguments

lambda

Penalty factor to be applied

X

Design matrix of regression problem

beta

true value of parameter vector to simulate from

sigma

true value of square root of variance parameter for simulating.

penalize

Vector giving penalty structure. Supplied to glmnet as 'penalty.factor'. By default, all coefficients except first are penalized.

rescale.lambda

Should lambda be rescaled to account for the default re-scaling done by glmnet?

ind

Index of coefficient to be returned. Value of 0 implies all coefficients (i.e. the full parameter vector estimate)

Details

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.

Author(s)

Joshua Keller


[Package eshrink version 0.1.2 Index]