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", ...)
the data from the time series: variables in columns and observations in rows
order of the VAR model
the penalty function to use. Possible values
are "ENET"
, "SCAD"
or "MCP"
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"
).
A
the list (of length p
) of the estimated matrices
of the process
fit
the results of the penalized LS estimation
mse
the mean square error of the cross validation
time
elapsed time for the estimation
residuals
the time series of the residuals