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{Σ}_{\varepsilon} are plotted against a specified range of their penalty parameter (keeping the other penalty parameter fixed).

Usage

1
2
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 λ_a (the penalty parameter for the regression coefficient matrix \mathbf{A}).

lambdaPgrid

A numeric of length larger than one, comprising positive numbers only. It contains the grid points corresponding to the λ_{ω} (the penalty parameters for the inverse error covariance matrix \mathbf{Ω}_{\varepsilon} (=\mathbf{Σ_{\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{Σ}_{\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{Σ}_{\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 λ_{ω} equal to the minimum value of lambdaPgrid. If pathType="SigmaE", the regularization paths of (inverse of / possibly standardarized) \mathbf{Σ}_{\varepsilon} will be evaluated for λ_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".

Author(s)

Wessel N. van Wieringen <w.vanwieringen@vumc.nl>.

See Also

ridgePathS, ridgeP, ridgeVAR1.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# 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")

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.