Nodewise LASSO regressions to fit the precision matrix
Nodewise LASSO regressions to fit the precision matrix
Fits the precision matrix by running nodewise LASSO regressions.
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 TRUE, use parallel foreach to fit nodewise LASSO regressions. Parallel registered within the function.
ncores: number of cores used in parallelization
intercept: whether intercept be fitted (TRUE) or set to zero (FALSE). Default is FALSE.
K: number of folds of the cv loop. Default set to 20.
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. set.seed(seed) is used. seed is stored in the output list. Default set to as.numeric(Sys.Date()).
verbose: if TRUE, prints progress bar. Default set to FALSE.
registerpar: if TRUE, register parallelization using registerDoParallel. Default set to TRUE.
...: Other arguments that can be passed to tscv.sglfit .
Returns
thetafit object.
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.