A function to estimate a (possibly high-dimensional) multivariate VAR time series using penalized least squares methods, such as ENET, SCAD or MC+.
fitVAR(data, p =1, penalty ="ENET", method ="cv",...)
Arguments
data: the data from the time series: variables in columns and observations in rows
p: order of the VAR model
penalty: the penalty function to use. Possible values are "ENET", "SCAD" or "MCP"
method: possible values are "cv" or "timeSlice"
...: the options for the estimation. Global options are: threshold: if TRUE all the entries smaller than the oracle threshold are set to zero; scale: scale the data (default = FALSE)? nfolds: the number of folds used for cross validation (default = 10); parallel: if TRUE use multicore backend (default = FALSE); ncores: if parallel is TRUE, specify the number of cores to use for parallel evaluation. Options for ENET estimation: alpha: the value of alpha to use in elastic net (0 is Ridge regression, 1 is LASSO (default)); type.measure: the measure to use for error evaluation ("mse" or "mae"); nlambda: the number of lambdas to use in the cross validation (default = 100); leaveOut: in the time slice validation leave out the last leaveOutLast observations (default = 15); horizon: the horizon to use for estimating mse/mae (default = 1); picasso: use picasso package for estimation (only available for penalty = "SCAD" and method = "timeSlice").
Returns
A the list (of length p) of the estimated matrices of the process