
Determine Optimal Lag Order for VAR Model Using Information Criteria
Source:R/RcppExports.R
fAICBIC.RdFits VAR models for lag orders 1 through pmax and returns the lag
length that minimises each of three information criteria.
Arguments
- y
A T x N matrix of endogenous variables (T observations, N series).
- pmax
An integer specifying the maximum VAR lag order to consider.
- c
An integer (0 or 1) indicating whether to include a constant term (1 = include, 0 = exclude).
- exog
An optional T x M matrix of exogenous variables. Default is NULL.
Value
A list with three integer elements: aic — optimal lag length by Akaike IC; bic — optimal lag length by Bayesian IC; hq — optimal lag length by Hannan-Quinn IC.
Details
For each candidate lag order p the residual covariance Sigma = (e'e)/T is computed and the three criteria are evaluated as:
AIC = log(det(Sigma)) + 2 * (p*N^2 + N + M) / T
BIC = log(det(Sigma)) + log(T) * (p*N^2 + N + M) / T
HQ = log(det(Sigma)) + 2 * log(log(T)) * (p*N^2 + N + M) / T
where M is the number of exogenous variables.