Lambda.sel: Select the Penalty Parameter of LASSO-type Linear Regression

Description Usage Arguments Value Examples

Description

Use out-of-sample Root Mean Square Error to select the penalty parameter of LASSO-type linear regression.

Usage

1
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 ≤q α ≤q 1. See the glmnet command in R. Default value is 1.

Value

A list containing:

Examples

1
2
3
4
5
X <- cbind(rnorm(200),rnorm(200,2,1),rnorm(200,4,1))
y <- rnorm(200)
newX <- cbind(rnorm(200),rnorm(200,2,1),rnorm(200,4,1))
newy <- rnorm(200)
output <- Lambda.sel(X, y, newX, newy)

SLBDD documentation built on March 27, 2021, 9:07 a.m.

Related to Lambda.sel in SLBDD...