Learn R Programming

ragt2ridges (version 0.1.9)

optPenaltyVAR1: Automatic penalty parameter selection for the VAR(1) model.

Description

Automatic penalty parameter selection for the VAR(1) model through maximization of the leave-one-out cross-validated (LOOCV) log-likelihood.

Usage

optPenaltyVAR1(Y, lambdaMin, lambdaMax, 
lambdaInit=(lambdaMin+lambdaMax)/2, 
optimizer="nlm", ...)

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 centered covariate-wise.
lambdaMin
A numeric of length two, containing the minimum values of ridge penalty parameters to be considered. The first element is the ridge parameter corresponding to the penalty on $\mathbf{A}$, the matrix with auto-regression coefficients, while th
lambdaMax
A numeric of length two, containing the maximum values of ridge penalty parameters to be considered. The first element is the ridge parameter corresponding to the penalty on $\mathbf{A}$, the matrix with auto-regression coefficients, while th
lambdaInit
A numeric of length two, containing the initial values of ridge penalty parameters to be considered. The first element is the ridge parameter corresponding to the penalty on $\mathbf{A}$, the matrix with auto-regression coefficients, while th
optimizer
A character (either nlm (default) or optim) specifying which optimization function should be used: nlminb (default) or
...
Additional arguments passed on to loglikLOOCVVAR1.

Value

  • A numeric with the LOOCV optimal choice for the ridge penalty parameter.

References

Miok, V., Wilting, S.M., Van Wieringen, W.N. (2015), "Ridge estimation of the VAR(1) model and its time series chain graph from multivariate time-course omics data", submitted.

See Also

loglikLOOCVVAR1, ridgeVAR1.

Examples

Run this code
# set dimensions (p=covariates, n=individuals, T=time points)
p <- 3; n <- 4; T <- 10

# set model parameters
SigmaE <- diag(p)/4
A <- createA(3, "chain")

# generate data
Y <- dataVAR1(n, T, A, SigmaE)

# determine the optimal penalty parameter
optLambda <- optPenaltyVAR1(Y, rep(10^(-10), 2), rep(1000, 2))

# fit VAR(1) model
ridgeVAR1(Y, optLambda[1], optLambda[2])$A

Run the code above in your browser using DataLab