Refit by OLS on the lasso's selected support
Usage
morie_post_lasso(X, y, lam)
Arguments
- X
Numeric predictor matrix.
- y
Numeric response vector.
- lam
Lasso penalty used for the selection step.
Value
A list with support, coef, intercept,
predict, and the underlying lasso beta.
References
Belloni, A. & Chernozhukov, V. (2013).
Examples
set.seed(12)
X <- matrix(rnorm(100 * 4), 100, 4)
y <- 1 + X %*% c(2, 0, 0, -1) + rnorm(100, sd = 0.1)
pl <- morie_post_lasso(X, as.numeric(y), lam = 0.2)
round(pl$coef, 2)
#> [,1]
#> [1,] 1.00
#> [2,] 1.98
#> [3,] -0.98