thetafit {midasml} | R Documentation |
Nodewise LASSO regressions to fit the precision matrix Θ
Description
Fits the precision matrix Θ by running nodewise LASSO regressions.
Usage
thetafit(x, parallel = FALSE, ncores = getOption("mc.cores", NULL),
intercept = FALSE, K = 20, l = 5, seed = NULL, verbose = FALSE,
registerpar = TRUE, ...)
Arguments
x |
T by p data matrix, where T and p respectively denote the sample size and the number of regressors. |
parallel |
if |
ncores |
number of cores used in parallelization |
intercept |
whether intercept be fitted ( |
K |
number of folds of the cv loop. Default set to |
l |
the gap used to drop observations round test set data. See tscv.sglfit for more details. |
seed |
set a value for seed to control results replication, i.e. |
verbose |
if |
registerpar |
if |
... |
Other arguments that can be passed to tscv.sglfit. |
Details
The function runs tscv.sglfit p
times by regressing j
-th covariate on all other covariates excluding j
-th covariate. The precision matrix is then constructed based on LASSO estimates. Each nodewise LASSO regression tuning parameter λ is optimized using time series cross-validation. See tscv.sglfit for more details on cross-validation implementation.
Value
thetafit object.
Author(s)
Jonas Striaukas
Examples
set.seed(1)
x = matrix(rnorm(100 * 20), 100, 20)
thetafit(x = x, parallel = FALSE)