logLik.nlVar: Extract Log-Likelihood

View source: R/nlVar-methods.R

logLik.nlVarR Documentation

Extract Log-Likelihood

Description

Log-Likelihood method for VAR and VECM models.

Usage

## S3 method for class 'nlVar'
logLik(object, ...)

## S3 method for class 'VECM'
logLik(object, r, ...)

Arguments

object

object of class VAR computed by lineVar, or class VECM computed by VECM.

...

additional arguments to logLik.

r

The cointegrating rank. By default the rank specified in the call to VECM, but can be set differently by user.

Details

For a VAR, the Log-Likelihood is computed as in Luetkepohl (2006) equ. 3.4.5 (p. 89) and Juselius (2006) p. 56:

LL = -(TK/2) \log(2π) - (T/2) \log|Σ| - (1/2) ∑^{T} ≤ft [ (y_t - A^{'}x_t)^{'} Σ^{-1} (y_t - A^{'}x_t) \right ]

Where Σ is the Variance matrix of residuals, and x_t is the matrix stacking the regressors (lags and deterministic).

However, we use a computationally simpler version:

LL = -(TK/2) \log(2π) - (T/2) \log|Σ| - (TK/2)

See Juselius (2006), p. 57.

(Note that Hamilton (1994) 11.1.10, p. 293 gives + (T/2) \log|Σ^{-1}|, which is the same as -(T/2) \log|Σ|).

For VECM, the Log-Likelihood is computed in two different ways, depending on whether the VECM was estimated with ML (Johansen) or 2OLS (Engle and Granger).

When the model is estimated with ML, the LL is computed as in Hamilton (1994) 20.2.10 (p. 637):

LL = -(TK/2) \log(2π) - (TK/2) -(T/2) \log|\hatΣ_{UU}| - (T/2) ∑_{i=1}^{r} \log (1-\hatλ_{i})

Where Σ_{UU} is the variance matrix of residuals from the first auxiliary regression, i.e. regressing Δ y_t on a constant and lags, Δ y_{t-1}, …, Δ y_{t-p}. λ_{i} are the eigenvalues from the Σ_{VV}^{-1}Σ_{VU}Σ_{UU}^{-1}Σ_{UV}, see 20.2.9 in Hamilton (1994).

When the model is estimated with 2OLS, the LL is computed as:

LL = \log|Σ|

Where Σ is the variance matrix of residuals from the the VECM model. There is hence no correspondence between the LL from the VECM computed with 2OLS or ML.

Value

Log-Likelihood value.

Author(s)

Matthieu Stigler

References

Hamilton (1994) Time Series Analysis, Princeton University Press

Juselius (2006) The Cointegrated VAR model: methodology and Applications, Oxford Univesity Press

Luetkepohl (2006) New Introduction to Multiple Time Series Analysis, Springer

Examples


data(zeroyld)

#Fit a VAR
VAR <- lineVar(zeroyld, lag=1)
logLik(VAR)

#'#Fit a VECM
vecm <- VECM(zeroyld, lag=1, r=1, estim="ML")
logLik(vecm)


tsDyn documentation built on Feb. 16, 2023, 6:57 p.m.