Description Usage Arguments Value Note Author(s) References See Also Examples
View source: R/loglikLOOCVVAR2.r
Evaluation of the (minus) leave-one-out cross-validated log-likelihood of the VAR(2) model for given choices of the ridge penalty parameters (λ_{a1}, λ_{a2} and λ_{ω} for the lag one autoregression coefficient matrix \mathbf{A}_1, lag two autoregression coefficient matrix \mathbf{A}_2 of time-varying covariates, and the inverse error covariance matrix \mathbf{Ω}_{\varepsilon} (=\mathbf{Σ_{\varepsilon}^{-1}}), respectively). The functions also works with a (possibly) unbalanced experimental set-up. The VAR(2)-process is assumed to have mean zero.
| 1 | loglikLOOCVVAR2(lambdas, Y, unbalanced=matrix(nrow=0, ncol=2), ...)
 | 
| lambdas |  A  | 
| Y |  Three-dimensional  | 
| unbalanced |  A  | 
| ... |   Other arguments to be passed to the  | 
A numeric of length one: the minus (!) LOOCV log-likelihood.
The minus LOOCV log-likelihood is returned as standard optimization procedures in R like nlminb and constrOptim minimize (rather then maximize). Hence, by providing the minus LOOCV log-likelihood the function loglikLOOCVVAR2 can directly used by these optimization procedures.
Wessel N. van Wieringen <w.vanwieringen@vumc.nl>
Miok, V., Wilting, S.M., Van Wieringen, W.N. (2019), “Ridge estimation of network models from time-course omics data”, Biometrical Journal, 61(2), 391-405.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # set dimensions (p=covariates, n=individuals, T=time points)
p <- 3; n <- 12; T <- 10
# set model parameters
SigmaE <- diag(p)/4
A1 <- createA(p, topology="clique", nonzeroA=0.1, nClique=1)
A2 <- createA(p, topology="hub", nonzeroA=0.1, nHubs=1)
# generate data
Y <- dataVAR2(n, T, A1, A2, SigmaE)
## determine optimal values of the penalty parameters
## Not run: optLambdas <- constrOptim(c(1,1, 1), loglikLOOCVVAR2, gr=NULL, 
## Not run:               ui=diag(3), ci=c(0,0,0), Y=Y,
## Not run:               control=list(reltol=0.01))$par 
# ridge ML estimation of the VAR(2) parameter estimates with 
# optimal penalty parameters
optLambdas <- c(0.1, 0.1, 0.1)
ridgeVAR2(Y, optLambdas[1], optLambdas[2], optLambdas[3])
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.