Essentials of Time Series Modeling

Chapter 6 in The Essentials of Time Series Modeling: An Applied Treatment with Emphasis on Topics Relevant to Financial Analysis © by Houston H. Stokes 20xx. All rights reserved. Preliminary Draft 23 September 2012

Chapter 6

Filtering and Cointegration Tests of Economic series

6.0 Chapter Overview

6.1 Cointegration

6.2 Engle-Granger (1987) Cointegration Testing

6.3 The ADL Cointegration Test variant.

6.4 A Digression on Unit Root Tests

Table 6.1 Selected Values from Empirical Cumulative Distribution of

6.5 Further Discussion of the Unit Root Tests used with the Cointegration Example

6.6 Cointegration Tests using the Stock-Watson Approach

6.7 Cointegration Tests using the Johansen Approach

6.8 Conclusions

Filtering and Cointegration Tests of Economic series

6.0 Chapter Overview

The Hodrick-Prescott and Baxter-King filters are alternative ways to decompose a series into its trend and deviations from the trend. Study of these decompositions provides insight into many economic models. An advantage of this modeling strategy is that both high frequency and low frequency information in each filtered series has been removed and analysis is confined to the middle frequencies. Unit root complications have been removed by assumption. However removal of the low frequency information of the series rules out the study of long-run adjustment. To handle such unit root issues, cointegration analysis is required.Cointegration refers to the study of the possible dynamic relationship between n series where one or more have unit roots of order k (i. e. are I(k)). For added detail see Enders (1995, 2004, 2010) or Hamilton (1994, 19) from which much of this discussion has been taken. The purpose of this chapter is to outline a number of techniques suggested to study cointegration and illustrate their application using the B34Smatrix command subroutines. After a brief discussion of cointegration, the Engle-Granger method, the Stock-Watson method, the ADL method and the Johansen method will be discussed and illustrated.

6.1 Cointegration

Cointegration analysis tests whether a linear combination of variables having unit roots (I(1)) is in fact stationary. Whether or not this is true has major implications on whether a proposed model could possibly be correct.

A model involving a linear combination of variables where one or more series have unit roots must produce a stationary error process. Given that i =interest rate on t bills and M = the M2 money supply it is logically not possible that models of the form could both be true.

Equilibrium theories involving nonstationary variables require the existence of a combination of the variables that are stationary. If this condition is not met, the theory cannot be correct. Prior to Grangers work on cointegration, this was not widely appreciated.

Example 1. Friedman asserts a relationship between consumption (C), permanent income and transitory income .

(6.1-1)

where C and are I(1) while is I(0). Permanent income theory requires that be stationary.

Example 2. The unbiased forward market hypothesis suggests that in equilibrium

(6.1-2)

where S = spot exchange rate and F = the forward exchange rate and is the expectation of the spot rate in period t+1 in period t. We assume and are I(1). If the unbiased forward market hypothesis is true, a linear combination of the nonstationary spot and forward exchange rates must be stationary.

Example 3. Purchasing Power Parity theory postulates a pattern between the three I(1) series

=log exchange rate

= log domestic prices

=log foreign prices

PPP theory requires that a linear combination of must be stationary.

In general case, long run equilibrium between series implies

(6.1-3)

Define .

The equilibrium error must be stationary for there to be long run equilibrium.

is cointegrated of order d, b ( ~ CI(d,b)) if:

- All components of are integrated of order d.

- There exists a vector such that is integrated of order (d-b) where b > 0.

is the cointegrating vector.

Cointegration implies a linear combination of nonstationary series. Nonlinear relationships can not be tested at this time but MARS models that have nonstationary inputs and a stationary output are actually testing such models.

The cointegrating vector that makes a linear combination of n I(1) series stationary is not unique. It could be multiplied by a scalar or normalized.

All variables in the model must be integrated of the same order. Not all I(d) variables are cointegrated.

A finding that n series are not cointegrated implies that there is no long run relationship or equilibrium between such variables.

If all series are not integrated of the same order, then there cannot be a long run relationship between these series.

If has n components or series there can be as many as n-1 linear independent cointegrating vectors. The number of cointegrating vectors is the cointegrating rank of

A series may have more than one cointegrating vector. Enders asserts money demand can be estimated from

(6.1-4)

model feedback can be estimated as

(6.1-5)

This implies two cointegrating vectors

(6.1-6)

Most economic series are I(1). Stock-Watson (1988) observed that cointegreated variables share common stochastic trends. Assume two series.. Define random walk process representing trend in variable i in period t.

(6.1-7)

If and are CI(1,1) this implies that must be stationary.

(6.1-8)

From equation (6.1-8) must vanish or

(6.1-9)

from equation (6.1-9) we know that

(6.1-10)

The importance of (6.1-10) is that two I(1) stochastic process must have the same stochastic trend (up to a scaler) if they are to be CI(1,1). The parameters of the cointegrating vector must be such that they purge or remove the trend from the linear combination. In general, cointegration will occur whenever the trend in one variable can be expressed as a linear combination of the trends in the other variables.

If variables are cointegrated, their time paths are influenced by the extent of any deviation from long-run equilibrium. For example, if long run and short run interest rates are cointegrated and long rates move up for some reason, the short term rate must ultimately rise relative to the long rate.

An error correction modelis implied if the short-run dynamics of variables are influenced by the deviation from equilibrium. Assume and are the short run and long term interest rates. A simple error correction model is

(6.1-11)

Long run equilibrium implies that

(6.1-12)

If and are stationary then the two interest rates must be cointegrated with cointegrating vector (1 , -). A more general model useful in testing is

(6.1-13)

Equation (6.1-13) is a VAR model with added error correction terms and which are estimated as the residuals of a first pass equation where and the residuals are retained. and are speed of adjustment terms. If the speed of adjustment terms are significant, it suggests that the short-tem dynamics of the variables in the system are influenced by the deviation from equilibrium of the I(1) variables. In such models (where the inputs are I(1)) the absence of Granger causality for cointegrated variables requires the additional condition that the speed of adjustment coefficient be equal to zero.

For cointegration to be found, at least one of speed of adjustment coefficients must be non zero. In the general case define , = k by 1 intercept vector, = k by 1 speed of adjustment vector, = k by m polynomial matrix in the lag B for lag i

(6.1-14)

Assuming all variables in X are I(1), solving (6.1-14) yields

(6.1-15)

Since every term on the right is stationary, then must be stationary. Each row in is a cointegrating vector of X. If all elements of the speed of adjustment vector are zero there is no error correction representation and the usual VAR representation can be used. If some elements in are not equal zero, the usual VAR model is not correct.

It can be shown[1] that “the restrictions necessary to ensure that the variables are CI(1,1 guarantee that an error-correction model exists.” A more comprehensive proof is given in Wei (2006). This analysis is based on the Granger representation theorem that states that for any set of I(1) variables, error correction and cointegration are equivalent representations.

Cointegration necessitates coefficient restrictions in a VAR Model. One cannot just put first differences on right. One needs to place the residuals from the first stage equation on the levels on the right of the VAR model in addition to the differences. By using the residuals in all VAR equations, we are implicitly placing a restriction. It is not clear what variable to place on the left in (6.12). There is some evidence that it might make a difference in small samples which variable is placed on the left.

In general both variables in a cointegreated system may respond to a deviation from long-run adjustment, but this may not be the case. Moving cointegration models test if this occurs the same over time.

In a cointegrated system, a variable does not Granger cause if lagged values do not enter the equation and if does not respond to the deviation from long-run equilibrium.

The Stock-Watson (1993) and Johansen(1988, 1991) testing methods are complex and will be discussed in sections 6.6 and 6.7. The Engle-Granger approach is substantially easier to use and is discussed next and in section 6.5. Section 6.3 discusses the ADL variant.

6.2Engle-Granger (1987)Cointegration Testing

The Engle-Granger (1987) method of testing for cointegration is relatively easy to implement and understand. Using data on long and short interest rates from Enders (2004) first proceed to testand to see if they are integrated to the same level. The Phillips-Perron or Dickey Fuller Tests are used first to see if the series have unit roots and if so if they are integrated to the same degree. If so proceed.

2. Estimate the long run relationship

(6.2-1)

If is stationary while both and are I(1) then the two series are cointegrated of order (1,1). Following Engle-Granger (1987) as discussed in Enders (2004), the simplest way to test if has a unit root is to proceed to estimate the Dickey- Fuller equation. However the usual Dickey Fuller tables cannot be used since the sequence was generated from a regression and as a result the actual population error is not known. Engle-Granger (1987) have provided alternative tables which are given in Enders (2004) table C. If shows autocorrelation, use the augmented Dickey Fuller Equation.

3. In the augmented VAR model use of in place of will avoid the constrained estimation problem. Greene (1997 page 857) indicates that the fact that was estimated in a two step manner is not a problem. In a model of the form of

(6.2-2)

the usual tests can be applied. The and measure the speed of adjustment.

The B34S matrix command has a number of subroutines that can be used to study cointegration and how the adjustment might change over time. Problems using these routines are discussed next.

RoutineTask

coint2 Cointegration Tests of Two Series

coint2lm Cointegration Tests of Two Series, OLS, L1, MM

coint2m Moving Cointegration of Two Series

coint2me Moving Cointegration of Two Series - Extended Args.

coint2m2 Moving Cointegration of Two Series OLS, L1, MM

coint3 Cointegration Tests of Three Series

coint3me Moving Cointegration of Three Series – Extended Args.

The routine coint2, which is listed next, implements (6.2-2) where OLS, MARS, GAM and PPREG models are allowed for the EC equation estimation depending on the setting of the method switch. While most estimation is done using OLS and the residual of the error correction equation tested to see if it has a unit root. It is possible that if a unit root is found, use of a nonlinear procedure to test

subroutine coint2(method,m,alpha,deg,mi,nk,x,y,xname,yname,

dfx,dfy,adfx,adfy,

lagx,lagy,speedx,speedy,tspeedx,tspeedy,

dfx2,dfy2,adfx2,adfy2,dflag,resid0,resid1,resid2,iprint

);

/; *******************************************************************

/; Tests for Cointegration using Engle Procedure and two series

/; allows for OLS, MARS, GAM and ppreg models

/; Method = 0 => OLS, =1 => MARS, =2 => GAM, =3 => PPREG

/; m = # of trees for PPREG (method =3)

/; alpha = smoothing coef for ppreg usually = 0.0

/; deg = degree for gam estimation. Usually = 3.

/; mi = maximum number of interactions for mars. -n range 1-3

/; nk = number of knots for mars

/; x = first series

/; y = second series

/; xname = name of first series set with call character(xname,' ')

/; yname = name of second series set with call character(yname,' ')

/; dfx = Unit root test for x

/; dfy = Unit root test for y

/; adfx = Augmented DF test for x for lag=dflag

/; adfy = Augmented DF test for y for lag=dflag

/; lagx = Number of lags of x

/; lagy = Number of lags of y

/; speedx = Speed of adjustment of x

/; speedy = Speed of adjustment of y

/; tspeedx= t stat of speedx

/; tspeedy= t stat of speedy

/; dfx2 = Unit root test for x RES

/; dfy2 = Unit root test for y RES

/; adfx2 = Augmented DF test for x RES for lag=dflag

/; adfy2 = Augmented DF test for y RES for lag=dflag

/; dflag = Lag of DF test

/; resid0 = Residual for Cointegrating Eq

/; resid1 = Residual for Equation 1

/; resid2 = Residual for Equation 2

/; iprint = 0 no print, = 1 print

/; *******************************************************************

/;

/; Built 9 September 2012

/;

if(iprint.ne.0)then;

call print(' ':);

call print('------':);

if(method.eq.0)

call print('Tests for Cointegration using OLS for EC Model':);

if(method.eq.1)

call print('Tests for Cointegration using MARS for EC Model':);

if(method.eq.2)

call print('Tests for Cointegration using GAM for EC Model':);

if(method.eq.3)

call print('Tests for Cointegration using PPREG for EC Model':);

call print('------':);

call print('X series was ',xname);

call print('Y Series was ',yname);

call print(' ':);

call print('Unit root tests for Series x and y':);

call df(x,dfx :print); call df(y,dfy :print);

call df(x,adfx:adf dflag :print); call df(y,adfy:adf dflag :print);

call olsq(x,y:print);

call print(' ':);

call print('DF and Augmented DF tests of Residual':);

call df(%res,dd :print); call df(%res,dd2 :adf dflag :print);

endif;

if(iprint.eq.0)then;

call df(x,dfx); call df(y,dfy);

call df(x,adfx:adf dflag); call df(y,adfy:adf dflag);

call olsq(x,y);

endif

resid0=%res;

difx=dif(x); dify=dif(y); rres=goodrow(lag(%res,-1));

if(iprint.ne.0)then;

if(method.eq.0)

call olsq(difx rres{1} difx{1 to lagx} dify{1 to lagy}:print);

if(method.eq.1)

call marspline(difx rres{1} difx{1 to lagx} dify{1 to lagy}

:mi mi :nk nk :print);

if(method.eq.2)

call gamfit(difx rres[predictor,deg]{1}

difx[predictor,deg]{1 to lagx}

dify[predictor,deg]{1 to lagy} :print);

if(method.eq.3)

call ppreg(difx rres{1} difx{1 to lagx} dify{1 to lagy}

:m m :alpha alpha :print);

endif;

if(iprint.eq.0)then;

if(method.eq.0)

call olsq(difx rres{1} difx{1 to lagx} dify{1 to lagy});

if(method.eq.1)

call marspline(difx rres{1} difx{1 to lagx} dify{1 to lagy}

:mi mi :nk nk);

if(method.eq.2)

call gamfit(difx rres[predictor,deg]{1}

difx[predictor,deg]{1 to lagx}

dify[predictor,deg]{1 to lagy});

if(method.eq.3)

call ppreg(difx rres{1} difx{1 to lagx} dify{1 to lagy}

:m m :alpha alpha);

call df(%res,dfx2); call df(%res,adfx2 :adf dflag);

endif;

speedx=%coef(1); resid1=%res; tspeedx=%t(1);

if(iprint.ne.0)then;

if(method.eq.0)

call olsq(dify rres{1} difx{1 to lagx} dify{1 to lagy} :print);

if(method.eq.1)

call marspline(dify rres{1} difx{1 to lagx} dify{1 to lagy} :print

:mi mi :nk nk);

if(method.eq.2)

call gamfit(dify rres[predictor,deg]{1}

difx[predictor,deg]{1 to lagx}

dify[predictor,deg]{1 to lagy}

:print);

if(method.eq.3)

call ppreg(dify rres{1} difx{1 to lagx} dify{1 to lagy}

:m m :alpha alpha :print);

endif;

if(iprint.eq.0)then;

if(method.eq.0)call olsq(dify rres{1} difx{1 to lagx} dify{1 to lagy});

if(method.eq.1)

call marspline(dify rres{1} difx{1 to lagx} dify{1 to lagy}

:mi mi :nk nk);

if(method.eq.2)

call gamfit(dify rres[predictor,deg]{1}

difx[predictor,deg]{1 to lagx}

dify[predictor,deg]{1 to lagy});

if(method.eq.3)

call ppreg(dify rres{1} difx{1 to lagx} dify{1 to lagy}

:m m :alpha alpha);

call df(%res,dfy2); call df(%res,adfy2 :adf dflag);

endif;

speedy=%coef(1); resid2=%res; tspeedy=%t(1);

if(iprint.ne.0)then;

call print(' ':);

call print('DF Tests on two equations ':);

call df(resid1,adfx1 :print);

call df(resid2,adfy1 :print);

call print(' ':);

call print('Augmented DF Tests on the Two Equations':);

call df(resid1,adfx2 :adf dflag :print);

call df(resid2,adfy2 :adf dflag :print);

endif;

return;

end;

The user inputs the series x and y, their names (xname, yname), the number of lags on x and y (lagx, lagy) and the number of lags on the Dickey Fuller Test (dflag). The switch iprint controls output. The switches method, m, alpha,deg, mi and nk control the parameters of the various estimation methods used to estimate equation (6.2-2). The next example uses coint2to test two of the Enders series and is listed next.

b34sexec options ginclude('b34sdata.mac') noheader

macro(coint6); b34srun;

b34sexec matrix;

call loaddata;

call load(coint2);

/; call print(coint2);

call character(xname,'Enders y Series');

call character(yname,'Enders z Series');

call echooff;

lagx=1; lagy=1; dflag=4;

m=20; alpha=0.0; deg=3.; mi=2; nk=20;

do method=0,3;

call coint2(method,m,alpha,deg,mi,nk,y,z,xname,yname,dfx,dfy,

adfx,adfy,lagx,lagy,speedx,speedy,tspeedx,tspeedy,

dfx2,dfy2,adfx2,adfy2,dflag,resid0,resid1,resid2,1);

call print(speedx,speedy,tspeedx,tspeedy);

enddo;

b34srun;

Edited output from running this test problem is given next. Estimation using OLS, MARS GAM and PPREG is shown for the 2 series model consisting of the y and z series. Analysis of the two series indicate a failure to reject a unit root. .

B34S Matrix Command. d/m/y 10/ 9/12. h:m:s 18:59:16.

------

Tests for Cointegration using OLS for EC Model

------

X series was

XNAME = Enders y Series

Y Series was

YNAME = Enders z Series

Unit root tests for Series x and y

Dickey-Fuller Test (I) lag 0 t -0.4148 prob reject I(i) < 0.90%

Critical Values: 99% -2.586 , 95% -1.943 , 90% -1.617

Dickey-Fuller Test (I) lag 0 t 0.6877E-01 prob reject I(i) < 0.90%