Lambda.sel: Select the Penalty Parameter of LASSO-type Linear Regression
Description
Use out-of-sample Root Mean Square Error to select the penalty parameter of
LASSO-type linear regression.
Usage
Lambda.sel(X, y, newX, newY, family = "gaussian", alpha = 1)
Arguments
X
Matrix of predictors of the estimation sample.
y
Dependent variables of the estimation sample.
newX
Design matrix in the forecasting subsample.
newY
Dependent variable in the forecasting subsample.
family
Response type. See the glmnet command in R. Possible types are "gaussian", "binomial",
"poisson", "multinomial", "cox", "mgaussian". Default is "gaussian".
alpha
The elasticnet mixing parameter, with \(0 \leq \alpha \leq 1\). See the glmnet command in R. Default value is 1.
Value
A list containing:
lambda.min - lambda that achieves the minimum mean square error.
beta - estimated coefficients for lambda.min.
mse - mean squared error.
lambda - the actual sequence of lambda values used.