serial(x, lags.pt = 16, lags.bg = 5, type = c("PT.asymptotic",
"PT.adjusted", "BG", "ES") )
varest
vec2var
varcheck
htest
htest
htest
type = "PT.asymptotic"
. For smaller sample sizes
and/or values of $h$ that are not sufficiently large, a corrected
test statistic is computed as:
$$Q_h^* = T^2 \sum_{j = 1}^h
\frac{1}{T - j}tr(\hat{C}_j'\hat{C}_0^{-1}\hat{C}_j\hat{C}_0^{-1}) \quad ,$$
This test statistic can be accessed, if type = "PT.adjusted"
is
set.
The Breusch-Godfrey LM-statistic is based upon the following auxiliary
regressions:
$$\bold{\hat{u}}_t = A_1 \bold{y}_{t-1} + \ldots + A_p\bold{y}_{t-p} +
CD_t + B_1\bold{\hat{u}}_{t-1} + \ldots + B_h\bold{\hat{u}}_{t-h} +
\bold{\varepsilon}_t$$
The null hypothesis is: $H_0: B_1 = \ldots = B_h = 0$ and
correspondingly the alternative hypothesis is of the form $H_1:
\exists \; B_i \ne 0$ for $i = 1, 2, \ldots, h$. The test statistic
is defined as:
$$LM_h = T(K - tr(\tilde{\Sigma}_R^{-1}\tilde{\Sigma}_e)) \quad ,$$
where $\tilde{\Sigma}_R$ and $\tilde{\Sigma}_e$ assign the
residual covariance matrix of the restricted and unrestricted
model, respectively. The test statistic $LM_h$ is distributed as
$\chi^2(hK^2)$. This test statistic is calculated if type =
"BG"
is used.
Edgerton and Shukur (1999) proposed a small sample correction, which
is defined as:
$$LMF_h = \frac{1 - (1 - R_r^2)^{1/r}}{(1 - R_r^2)^{1/r}} \frac{Nr -
q}{K m} \quad ,$$
with $R_r^2 = 1 - |\tilde{\Sigma}_e | / |\tilde{\Sigma}_R|$,
$r = ((K^2m^2 - 4)/(K^2 + m^2 - 5))^{1/2}$, $q = 1/2 K m - 1$
and $N = T - K - m - 1/2(K - m + 1)$, whereby $n$ is the
number of regressors in the original system and $m = Kh$. The
modified test statistic is distributed as $F(hK^2, int(Nr -
q))$. This modified statistic will be returned, if type =
"ES"
is provided in the call to serial()
.VAR
, vec2var
, plot
data(Canada)
var.2c <- VAR(Canada, p = 2, type = "const")
serial(var.2c, lags.pt = 16, type = "PT.adjusted")
Run the code above in your browser using DataLab