Learn R Programming

tsDyn (version 11.0.4)

logLik.nlVar: Extract Log-Likelihood

Description

Log-Likelihood method for VAR and VECM models.

Usage

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

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

Value

Log-Likelihood value.

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.

Author

Matthieu Stigler

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\pi) - (T/2) \log|\Sigma| - (1/2) \sum^{T} \left [ (y_t - A^{'}x_t)^{'} \Sigma^{-1} (y_t - A^{'}x_t) \right ] $$ Where \(\Sigma\) 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\pi) - (T/2) \log|\Sigma| - (TK/2) $$

See Juselius (2006), p. 57.

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

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\pi) - (TK/2) -(T/2) \log|\hat\Sigma_{UU}| - (T/2) \sum_{i=1}^{r} \log (1-\hat\lambda_{i}) $$ Where \(\Sigma_{UU}\) is the variance matrix of residuals from the first auxiliary regression, i.e. regressing \(\Delta y_t\) on a constant and lags, \(\Delta y_{t-1}, \ldots, \Delta y_{t-p}\). \(\lambda_{i}\) are the eigenvalues from the \(\Sigma_{VV}^{-1}\Sigma_{VU}\Sigma_{UU}^{-1}\Sigma_{UV}\), see 20.2.9 in Hamilton (1994).

When the model is estimated with 2OLS, the LL is computed as: $$ LL = \log|\Sigma| $$

Where \(\Sigma\) 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.

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

Run this code

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)

Run the code above in your browser using DataLab