serial.test {vars}R Documentation

Test for serially correlated errors

Description

This function computes the multivariate Portmanteau- and Breusch-Godfrey test for serially correlated errors.

Usage

serial.test(x, lags.pt = 16, lags.bg = 5, type = c("PT.asymptotic",
"PT.adjusted", "BG", "ES") )

Arguments

x

Object of class ‘varest’; generated by VAR(), or an object of class ‘vec2var’; generated by vec2var().

lags.pt

An integer specifying the lags to be used for the Portmanteau statistic.

lags.bg

An integer specifying the lags to be used for the Breusch-Godfrey statistic.

type

Character, the type of test. The default is an asymptotic Portmanteau test.

Details

The Portmanteau statistic for testing the absence of up to the order hh serially correlated disturbances in a stable VAR(p) is defined as:

Qh=Tj=1htr(C^jC^01C^jC^01), Q_h = T \sum_{j = 1}^h tr(\hat{C}_j'\hat{C}_0^{-1}\hat{C}_j\hat{C}_0^{-1}) \quad ,

where C^i=1Tt=i+1Tu^tu^ti\hat{C}_i = \frac{1}{T}\sum_{t = i + 1}^T \bold{\hat{u}}_t \bold{\hat{u}}_{t - i}'. The test statistic is approximately distributed as χ2(K2(hp))\chi^2(K^2(h - p)). This test statistic is choosen by setting type = "PT.asymptotic". For smaller sample sizes and/or values of hh that are not sufficiently large, a corrected test statistic is computed as:

Qh=T2j=1h1Tjtr(C^jC^01C^jC^01), 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:

u^t=A1yt1++Apytp+CDt+B1u^t1++Bhu^th+εt \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: H0:B1==Bh=0H_0: B_1 = \ldots = B_h = 0 and correspondingly the alternative hypothesis is of the form H1:  Bi0H_1: \exists \; B_i \ne 0 for i=1,2,,hi = 1, 2, \ldots, h. The test statistic is defined as:

LMh=T(Ktr(Σ~R1Σ~e)), LM_h = T(K - tr(\tilde{\Sigma}_R^{-1}\tilde{\Sigma}_e)) \quad ,

where Σ~R\tilde{\Sigma}_R and Σ~e\tilde{\Sigma}_e assign the residual covariance matrix of the restricted and unrestricted model, respectively. The test statistic LMhLM_h is distributed as χ2(hK2)\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:

LMFh=1(1Rr2)1/r(1Rr2)1/rNrqKm, LMF_h = \frac{1 - (1 - R_r^2)^{1/r}}{(1 - R_r^2)^{1/r}} \frac{Nr - q}{K m} \quad ,

with Rr2=1Σ~e/Σ~RR_r^2 = 1 - |\tilde{\Sigma}_e | / |\tilde{\Sigma}_R|, r=((K2m24)/(K2+m25))1/2r = ((K^2m^2 - 4)/(K^2 + m^2 - 5))^{1/2}, q=1/2Km1q = 1/2 K m - 1 and N=TKm1/2(Km+1)N = T - K - m - 1/2(K - m + 1), whereby nn is the number of regressors in the original system and m=Khm = Kh. The modified test statistic is distributed as F(hK2,int(Nrq))F(hK^2, int(Nr - q)). This modified statistic will be returned, if type = "ES" is provided in the call to serial().

Value

A list with class attribute ‘varcheck’ holding the following elements:

resid

A matrix with the residuals of the VAR.

pt.mul

A list with objects of class attribute ‘htest’ containing the multivariate Portmanteau-statistic (asymptotic and adjusted.

LMh

An object with class attribute ‘htest’ containing the Breusch-Godfrey LM-statistic.

LMFh

An object with class attribute ‘htest’ containing the Edgerton-Shukur F-statistic.

Note

This function was named serial in earlier versions of package vars; it is now deprecated. See vars-deprecated too.

Author(s)

Bernhard Pfaff

References

Breusch, T . S. (1978), Testing for autocorrelation in dynamic linear models, Australian Economic Papers, 17: 334-355.

Edgerton, D. and Shukur, G. (1999), Testing autocorrelation in a system perspective, Econometric Reviews, 18: 43-386.

Godfrey, L. G. (1978), Testing for higher order serial correlation in regression equations when the regressors include lagged dependent variables, Econometrica, 46: 1303-1313.

Hamilton, J. (1994), Time Series Analysis, Princeton University Press, Princeton.

Lütkepohl, H. (2006), New Introduction to Multiple Time Series Analysis, Springer, New York.

See Also

VAR, vec2var, plot

Examples

data(Canada)
var.2c <- VAR(Canada, p = 2, type = "const")
serial.test(var.2c, lags.pt = 16, type = "PT.adjusted")

[Package vars version 1.6-1 Index]