Learn R Programming

ragt2ridges (version 0.1.9)

loglikVAR1: Log-likelihood of the VAR(1) model.

Description

Log-likelihood of the VAR(1) model specified by the supplied parameters

Usage

loglikVAR1(Y, A, P, unbalanced=matrix(nrow=0, ncol=2))

Arguments

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.
A
A matrix $\mathbf{A}$ of auto-regression parameters.
P
Inverse error covariance matrix $\mathbf{\Omega}_{\varepsilon} (=\mathbf{\Sigma_{\varepsilon}^{-1}})$.
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 mis

Value

  • The log-likelihood of the VAR(1) model with supplied parameters.

See Also

ridgeVAR1.

Examples

Run this code
# set dimensions
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)

# center data
Y <- centerVAR1data(Y)

# fit VAR(1) model
VAR1hat <- ridgeVAR1(Y, 1, 1)

# evaluate the log-likelihood of this fit.
loglikVAR1(Y, VAR1hat$A, VAR1hat$P)

Run the code above in your browser using DataLab