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

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

View source: R/loglikLOOCVVAR1fused.r

Description

Evaluation of the (minus) leave-one-out cross-validated log-likelihood of multiple VAR(1) models for given choices of the (fused) ridge penalty parameters (λ_a, λ_f and λ_{ω} for the autoregression coefficient matrice \mathbf{A}_g's 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(1)-processes are assumed to have mean zero.

Usage

1
loglikLOOCVVAR1fused(lambdas, Y, id, unbalanced=matrix(nrow=0, ncol=2), ...)

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} 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.

id

A vector with group indices comprising of integers only. First group is represented by '0', the next by '1', and so on until the last.

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.

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 loglikLOOCVVAR1fused 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. (2019), “Ridge estimation of network models from time-course omics data”, Biometrical Journal, 61(2), 391-405.

See Also

ridgeP and ridgeVAR1fused.

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, G=groups)
p <- 3; n <- 12; T <- 10; G <- 3

# set model parameters
SigmaE <- matrix(1/2, p, p)
diag(SigmaE) <- 1
A1 <- -createA(p, "clique", nCliques=1, nonzeroA=0.1)
A2 <- t(createA(p, "chain", nBands=1,   nonzeroA=0.1))
A3 <- (A1 + A2) / 2

# generate data
Y1 <- dataVAR1(n/G, T, A1, SigmaE)
Y2 <- dataVAR1(n/G, T, A2, SigmaE)
Y3 <- dataVAR1(n/G, T, A3, SigmaE)
Y  <- abind::abind(Y1, Y2, Y3, along=3)
id <- c(rep(1, n/G), rep(2, n/G), rep(3, n/G))-1

## determine optimal values of the penalty parameters
## Not run: optLambdas <- constrOptim(c(1,1,1), loglikLOOCVVAR1fused, gr=NULL, 
## Not run:               ui=diag(3), ci=c(0,0,0), Y=Y, id=id
## 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)
VAR1hats <- ridgeVAR1fused(Y, id, optLambdas[1], optLambdas[2], optLambdas[3])

ragt2ridges documentation built on Jan. 28, 2020, 5:08 p.m.