Description Usage Arguments Value Note Author(s) References See Also Examples
View source: R/loglikLOOCVcontourVARX1.r
Evaluates the leave-one-out cross-validated log-likelihood of the VARX(1) model over a grid of the ridge penalty parameters (λ_a and λ_b) for the autoregression and time-varying covariate regression coefficient matrices \mathbf{A} and \mathbf{B}, respectively, while keeping λ_{ω}, the penalty parameter of the inverse error covariance matrix \mathbf{Ω}_{\varepsilon} (=\mathbf{Σ_{\varepsilon}^{-1}}), fixed at a user-specified value. The result is plotted as a contour plot, which facilitates the choice of optimal penalty parameters. The function also works with a (possibly) unbalanced experimental set-up. The VARX(1)-process is assumed to have mean zero.
1 2 | loglikLOOCVcontourVARX1(lambdaAgrid, lambdaBgrid, lambdaPgrid, Y, X,
lagX=0, figure=TRUE, verbose=TRUE, ...)
|
lambdaAgrid |
A |
lambdaBgrid |
A |
lambdaPgrid |
A |
Y |
Three-dimensional |
X |
Three-dimensional |
lagX |
An |
figure |
A |
verbose |
A |
... |
Other arguments to be passed on (indirectly) to |
A list
-object with slots:
lambdaA |
A |
lambdaB |
A |
lambdaP |
A |
llLOOCV |
A |
When lambdaAgrid
, lambdaBgrid
and lambdaPgrid
are all vectors of length exceeding one, the contour is determined for the grid formed by the Cartesius product of lambdaAgrid
and lambdaBgrid
meanwhile restricting lambdaPgrid
to its first element.
Internally, this function calls the loglikLOOCVVARX1
-function, which evaluates the minus (!) LOOCV log-likelihood (for practical reasons). For interpretation purposes
loglikLOOCVcontourVARX1
provides the regular LOOCV log-likelihood (that is, without the minus).
Wessel N. van Wieringen <w.vanwieringen@vumc.nl>, Viktorian Miok.
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.
loglikLOOCVcontourVAR1
, loglikLOOCVcontourVAR1fused
.
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 27 28 29 30 31 | # 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)
## plot contour of cross-validated likelihood
## Not run: lambdaAgrid <- seq(0.01, 1, length.out=20)
## Not run: lambdaBgrid <- seq(0.01, 1000, length.out=20)
## Not run: lambdaPgrid <- seq(0.01, 1000, length.out=20)
## Not run: loglikLOOCVcontourVARX1(lambdaAgrid, lambdaBgrid, lambdaPgrid, Y, X)
## 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,
## Not run: control=list(reltol=0.01))$par
## add point of optimum
## Not run: points(optLambdas[1], optLambdas[2], pch=20, cex=2,
## Not run: col="red")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.