Select the Lasso Estimates from the Grid Search
Source:R/fitAutoReg-select-var-lasso.R
SelectVARLasso.Rd
Select the Lasso Estimates from the Grid Search
Arguments
- search
Object. Output of the
SearchVARLasso()
function.- crit
Character string. Information criteria to use. Valid values include
"aic"
,"bic"
, and"ebic"
.
Examples
YStd <- StdMat(dat_p2_yx$Y)
XStd <- StdMat(dat_p2_yx$X[, -1])
lambdas <- 10^seq(-5, 5, length.out = 100)
search <- SearchVARLasso(
YStd = YStd, XStd = XStd, lambdas = lambdas,
max_iter = 10000, tol = 1e-5
)
SelectVARLasso(search, crit = "ebic")
#> [,1] [,2] [,3] [,4] [,5] [,6]
#> [1,] 0.3440823 0.0000000 0.0000000 0.08601767 0.0000000 0.0000000
#> [2,] 0.0000000 0.4580172 0.0000000 0.00000000 0.2130337 0.0000000
#> [3,] 0.0000000 0.0000000 0.5889874 0.00000000 0.0000000 0.2746474
#> attr(,"lambda")
#> [1] 73.90722
#> attr(,"aic")
#> [1] 495.0721
#> attr(,"bic")
#> [1] 524.5066
#> attr(,"ebic")
#> [1] 544.44