Learn R Programming

ragt2ridges (version 0.3.4)

ridgePathVAR1: Visualize the ridge regularization paths of the parameters of the VAR(1) model

Description

Function that visualizes the regularization paths of the parameters of the VAR(1) model. The elements of the ridge ML estimate of either \(\mathbf{A}\) or (possibly standardized, inverse of) \(\mathbf{\Sigma}_{\varepsilon}\) are plotted against a specified range of their penalty parameter (keeping the other penalty parameter fixed).

Usage

ridgePathVAR1(Y, lambdaAgrid, lambdaPgrid, pathType="A", 
              plotTypeSigmaE="pcor", diag=FALSE, verbose=TRUE, ...)

Arguments

Y

Three-dimensional array containing the data. The first, second and third dimensions correspond to covariates, time and samples, respectively. The data are assumed to be centered covariate-wise.

lambdaAgrid

A numeric of length larger than one, comprising positive numbers only. It contains the grid points corresponding to the \(\lambda_a\) (the penalty parameter for the autoregression coefficient matrix \(\mathbf{A}\)).

lambdaPgrid

A numeric of length larger than one, comprising positive numbers only. It contains the grid points corresponding to the \(\lambda_{\omega}\) (the penalty parameters for the inverse error covariance matrix \(\mathbf{\Omega}_{\varepsilon} (=\mathbf{\Sigma_{\varepsilon}^{-1}})\)).

pathType

A character indicating of which parameter to plot its ridge regularization paths. Either "A" or "SigmaE".

plotTypeSigmaE

A character indicating the type of element for which a visualization of the regularization paths (of \(\mathbf{\Sigma}_{\varepsilon}\)) is desired. Must be one of: "pcor", "cor", "cov", "prec".

diag

A logical indicating if the diagonal elements should be retained for visualization of the regularization path of \(\mathbf{\Sigma}_{\varepsilon}\).

verbose

A logical indicator: should intermediate output be printed on the screen?

...

Other arguments to be passed to ridgeVAR1.

Details

If pathType="A", the regularization paths of \(\mathbf{A}\) will be evaluated for \(\lambda_{\omega}\) equal to the minimum value of lambdaPgrid. If pathType="SigmaE", the regularization paths of (inverse of / possibly standardarized) \(\mathbf{\Sigma}_{\varepsilon}\) will be evaluated for \(\lambda_a\) equal to the minimum value of lambdaAgrid.

Regularization paths may be visualized for (partial) correlations, covariances and precision elements. The type of element for which a visualization of the regularization paths is desired can be indicated by the argument plotType.

The arguments diag and plotTypeSigmaE are ignored when pathType="A".

See Also

ridgePathS, ridgeP, ridgeVAR1.

Examples

Run this code
# NOT RUN {
# set dimensions (p=covariates, n=individuals, T=time points)
p <- 3; n <- 4; T <- 10
     
# set model parameters
SigmaE <- diag(p)/4
A      <- createA(p, "chain")
     
# generate data
Y <- dataVAR1(n, T, A, SigmaE)

## Visualize regularization paths
lambdaAgrid <- seq(0.01, 1, length.out=20) 
lambdaPgrid <- seq(0.01, 1, length.out=20) 
ridgePathVAR1(Y, lambdaAgrid, lambdaPgrid, pathType="A")
# }

Run the code above in your browser using DataLab