Learn R Programming

ragt2ridges (version 0.3.4)

loglikLOOCVVAR1: Leave-one-out (minus) cross-validated log-likelihood of VAR(1) model

Description

Evaluation of the (minus) leave-one-out cross-validated log-likelihood of the VAR(1) model for given choices of the ridge penalty parameters (\(\lambda_a\) and \(\lambda_{\omega}\) for the autoregression coefficient matrix \(\mathbf{A}\) and the inverse error covariance matrix \(\mathbf{\Omega}_{\varepsilon} (=\mathbf{\Sigma_{\varepsilon}^{-1}})\), respectively). The functions also works with a (possibly) unbalanced experimental set-up. The VAR(1)-process is assumed to have mean zero.

Usage

loglikLOOCVVAR1(lambdas, Y, unbalanced=matrix(nrow=0, ncol=2), ...)

Arguments

lambdas

A numeric of length two, comprising positive values only. It contains the ridge penalty parameters to be used in the estimation of \(\mathbf{A}\) and the precision matrix of the errors, respectively.

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.

unbalanced

A matrix with two columns, indicating the unbalances in the design. Each row represents a missing design point in the (time x individual)-layout. The first and second column indicate the time and individual (respectively) specifics of the missing design point.

...

Other arguments to be passed to ridgeVAR1.

Value

A numeric of length one: the minus (!) LOOCV log-likelihood.

References

Miok, V., Wilting, S.M., Van Wieringen, W.N. (2017), ``Ridge estimation of the VAR(1) model and its time series chain graph from multivariate time-course omics data'', Biometrical Journal, 59(1), 172-191.

See Also

ridgeP and 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)

## determine optimal values of the penalty parameters
# }
# NOT RUN {
optLambdas <- constrOptim(c(1,1), loglikLOOCVVAR1, gr=NULL, 
# }
# NOT RUN {
              ui=diag(2), ci=c(0,0), Y=Y, 
# }
# NOT RUN {
              control=list(reltol=0.01))$par 
# }
# NOT RUN {
# ridge ML estimation of the VAR(1) parameter estimates with 
# optimal penalty parameters
optLambdas <- c(0.1, 0.1)
ridgeVAR1(Y, optLambdas[1], optLambdas[2])$A
# }

Run the code above in your browser using DataLab