loglikLOOCVVARX1: Leave-one-out (minus) cross-validated log-likelihood of...

Description Usage Arguments Value Note Author(s) References See Also Examples

View source: R/loglikLOOCVVARX1.r

Description

Evaluation of the (minus) leave-one-out cross-validated log-likelihood of the VARX(1) model for given choices of the ridge penalty parameters (λ_a, λ_b and λ_{ω} for the autoregression coefficient matrix \mathbf{A}, regression coefficient matrix \mathbf{B} 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 VARX(1)-process is assumed to have mean zero.

Usage

1
loglikLOOCVVARX1(lambdas, Y, X, unbalanced=matrix(nrow=0, ncol=2), lagX=0, ...)

Arguments

lambdas

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

Y

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

X

Three-dimensional array containing the time-varying covariate 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.

lagX

Integer, either 0 or 1, specifying whether \mathbf{X}_t or \mathbf{X}_{t-1} affects \mathbf{Y}_t, respectively.

...

Other arguments to be passed to ridgeVARX1.

Value

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

Note

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 loglikLOOCVVARX1 can directly used by these optimization procedures.

Author(s)

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

References

Miok, V., Wilting, S.M., Van Wieringen, W.N. (2018), “Ridge estimation of network models from time-course omics data”, Biometrical Journal, <DOI:10.1002/bimj.201700195>.

See Also

ridgeP and ridgeVARX1.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# set dimensions (p=covariates, n=individuals, T=time points)
p <- 3; n <- 12; T <- 10

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

# generate time-varying covariate data
X <- dataVAR1(n, T, Ax, SigmaE)

# regression parameter matrices of VARX(1) model
A <- createA(p, topology="clique", nonzeroA=0.1, nClique=1)
B <- createA(p, topology="hub", nonzeroA=0.1, nHubs=1)

# generate data
Y <- dataVARX1(X, A, B, SigmaE, lagX=0)

## determine optimal values of the penalty parameters
## Not run: optLambdas <- constrOptim(c(1,1, 1), loglikLOOCVVARX1, gr=NULL, 
## Not run:               ui=diag(3), ci=c(0,0,0), Y=Y, X=X, lagX=0,
## Not run:               control=list(reltol=0.01))$par 

# ridge ML estimation of the VAR(1) parameter estimates with 
# optimal penalty parameters
optLambdas <- c(0.1, 0.1, 0.1)
ridgeVARX1(Y, X, optLambdas[1], optLambdas[2], optLambdas[3], lagX=0)$A

wvanwie/ragt2ridges documentation built on May 4, 2019, 12:03 p.m.