This function computes the Akaike Information Criterion (AIC),
Bayesian Information Criterion (BIC),
and Extended Bayesian Information Criterion (EBIC)
for a given matrix of predictors X, a matrix of outcomes Y,
and a vector of lambda hyperparameters for Lasso regularization.
Arguments
- YStd
Numeric matrix. Matrix of standardized dependent variables (Y).
- XStd
Numeric matrix. Matrix of standardized predictors (X).
XStdshould not include a vector of ones in column one.- lambdas
Numeric vector. Lasso hyperparameter. The regularization strength controlling the sparsity.
- max_iter
Integer. The maximum number of iterations for the coordinate descent algorithm (e.g.,
max_iter = 10000).- tol
Numeric. Convergence tolerance. The algorithm stops when the change in coefficients between iterations is below this tolerance (e.g.,
tol = 1e-5).
Value
List with the following elements:
criteria: Matrix with columns for lambda, AIC, BIC, and EBIC values.
fit: List of matrices containing the estimated autoregressive and cross-regression coefficients for each lambda.
See also
Other Fitting Autoregressive Model Functions:
FitMLVARDynr(),
FitMLVARMplus(),
FitVARDynr(),
FitVARLassoSearch(),
FitVARLasso(),
FitVARMplus(),
FitVAROLS(),
LambdaSeq(),
ModelVARP1Dynr(),
ModelVARP2Dynr(),
OrigScale(),
PBootVARExoLasso(),
PBootVARExoOLS(),
PBootVARLasso(),
PBootVAROLS(),
RBootVARExoLasso(),
RBootVARExoOLS(),
RBootVARLasso(),
RBootVAROLS(),
StdMat()
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)
plot(x = 1:nrow(search$criteria), y = search$criteria[, 4],
type = "b", xlab = "lambda", ylab = "EBIC")