TESTING FOR NONSTATIONARITY 1 This sequence will describe two methods for detecting nonstationarity,...
-
Upload
jewel-french -
Category
Documents
-
view
230 -
download
0
description
Transcript of TESTING FOR NONSTATIONARITY 1 This sequence will describe two methods for detecting nonstationarity,...
TESTING FOR NONSTATIONARITY
1
This sequence will describe two methods for detecting nonstationarity, a graphical method involving correlograms and a more technical method involving unit root tests.
Autocorrelation function
for k = 1, ...
22 )()())((
XktXt
XktXtk XEXE
XXE
TESTING FOR NONSTATIONARITY
2
We will start with the graphical method. The autocorrelation function of a series Xt gives the theoretical correlation between the value of the series at time t and its value at time t + k, for values of k from 1 to (typically) about 20.
22 )()(
))((
XktXt
XktXtk XEXE
XXE
Autocorrelation function
for k = 1, ...
TESTING FOR NONSTATIONARITY
3
For example, the autocorrelation coefficient k for an AR(1) process is 2k.
22 )()(
))((
XktXt
XktXtk XEXE
XXE
Autocorrelation function
Autocorrelation function of an AR(1) process
kk 2
ttt XX 12
for k = 1, ...
TESTING FOR NONSTATIONARITY
4
For stationary processes the autocorrelation coefficients tend to 0 quite quickly as k increases. The figure shows the correlogram for an AR(1) process with 2 = 0.8.
kk 2
ttt XX 12
8.02
0.0
0.2
0.4
0.6
0.8
1.0
1 4 7 10 13 16 19
Correlogram of an AR(1) process
TESTING FOR NONSTATIONARITY
5
Higher order AR(p) processes will exhibit more complex behavior, but if they are stationary, the coefficients will eventually decline to 0.
Correlogram of an AR(1) process
0.0
0.2
0.4
0.6
0.8
1.0
1 4 7 10 13 16 19
kk 2
ttt XX 12
8.02
TESTING FOR NONSTATIONARITY
6
A moving average MA(q) process has nonzero weights for only the first q lags and 0 weights thereafter.
Correlogram of an AR(1) process
0.0
0.2
0.4
0.6
0.8
1.0
1 4 7 10 13 16 19
kk 2
ttt XX 12
8.02
TESTING FOR NONSTATIONARITY
7
In the case of nonstationary processes, the theoretical autocorrelation coefficients are not defined but one may be able to obtain an expression for E(rk), the expected value of the sample autocorrelation coefficients. For long time series, these coefficients decline slowly.
Correlogram of a random walk
ttt XX 1
0.0
0.2
0.4
0.6
0.8
1.0
1 4 7 10 13 16 19
TESTING FOR NONSTATIONARITY
8
The figure shows the correlogram for a random walk with 200 observations.
Correlogram of a random walk
ttt XX 1
0.0
0.2
0.4
0.6
0.8
1.0
1 4 7 10 13 16 19
TESTING FOR NONSTATIONARITY
9
Hence time series analysts can make an initial judgment as to whether a time series is nonstationary or not by computing its sample correlogram and seeing how quickly the coefficients decline.
Correlogram of a random walk
ttt XX 1
0.0
0.2
0.4
0.6
0.8
1.0
1 4 7 10 13 16 19
TESTING FOR NONSTATIONARITY
10
There are, however, two problems with using correlograms to identify nonstationarity. One is that a correlogram such as that shown above could result from a stationary AR(1) process with a high value of 2.
Correlogram of a random walk
ttt XX 1
0.0
0.2
0.4
0.6
0.8
1.0
1 4 7 10 13 16 19
TESTING FOR NONSTATIONARITY
11
The other problem is that the coefficients of a nonstationary process may decline quite rapidly if the series is not long. This is illustrated in the figure above, which shows the expected values of rk for a random walk when the series has only 50 observations.
Correlogram of a random walk
ttt XX 1
-0.2
0.0
0.2
0.4
0.6
0.8
1.0
1 4 7 10 13 16 19
ttt XX 121
TESTING FOR NONSTATIONARITY
12
A more formal method of detecting nonstationarity is often described as testing for unit roots, for reasons that are too technical to be explained here.
ttt XX 121
TESTING FOR NONSTATIONARITY
13
This remainder of this sequence will explain the logic behind the Augmented Dickey–Fuller test for nonstationarity and will apply the test to some of the series in the Demand Functions data set.
ttt XX 121
TESTING FOR NONSTATIONARITY
14
We will start with the very simple process shown above. For most economic series you can rule out the possibility that 2 is greater than 1, for that would imply that the series is explosive. Likewise you can rule out the possibility that it is less than –1.
ttt XX 121
1: 20 H
1: 21 H
TESTING FOR NONSTATIONARITY
15
111 22
2
22
X
1222 t
tX
In practice, there will be just two possibilities: 2 = 1, and –1 < 2 < 1. If 2 = 1, the process is nonstationary because its variance increases with t. If 2 lies between 1 and –1, the variance is fixed and the series is stationary.
ttt XX 121
1: 20 H
1: 21 H
TESTING FOR NONSTATIONARITY
16
111 22
2
22
X
1222 t
tX
The test is intended to discriminate between the two possibilities. The null hypothesis is that the process is nonstationary. We need a specific value of 2 when we define the null hypothesis, so we make H0: 2 = 1. The alternative hypothesis is then H1: 2 < 1.
ttt XX 121
tttt XXX 1211 )1(
01: 20 H
01: 21 H
1: 20 H
1: 21 H
TESTING FOR NONSTATIONARITY
17
111 22
2
22
X
1222 t
tX
Before performing the test, it is convenient to rewrite the model subtracting Xt–1 from both sides. To perform the test, we regress Xt on Xt–1 and test whether the slope coefficient is significantly different from 0.
ttt XX 121 )1(
tttt XXX 23121
TESTING FOR NONSTATIONARITY
18
One can generalize the test to allow for more complex dynamics. Here, for example, we hypothesize that Xt may depend on Xt–2 as well as Xt–1.
tttt XXX 23121
1: 320 H
1: 321 H
TESTING FOR NONSTATIONARITY
19
The condition for nonstationarity is now 2 + 3 = 1, and for stationarity 2 + 3 < 1. (The condition for stationarity is actually necessary but not sufficient. We will not be concerned with the other conditions.)
tttt XXX 23121
1: 320 H
1: 321 H
TESTING FOR NONSTATIONARITY
20
01: 320 H
01: 321 H
It will be convenient to rewrite the null and alternative hypotheses as shown.
tttt XXX 23121
1: 320 H
1: 321 H
TESTING FOR NONSTATIONARITY
21
01: 320 H
01: 321 H
tttt
tttt
ttttt
ttttt
XXXXXX
XXXXXXXX
)()1()1(
)1()1(
2131321
23131321
231313121
231211
We will now manipulate the model so that the null hypothesis can be tested with a t test. First, subtract Xt–1 from both sides.
tttt XXX 23121
1: 320 H
1: 321 H
TESTING FOR NONSTATIONARITY
22
01: 320 H
01: 321 H
tttt
tttt
ttttt
ttttt
XXXXXX
XXXXXXXX
)()1()1(
)1()1(
2131321
23131321
231313121
231211
Then add 3Xt–1 to the right side and subtract it again.
tttt XXX 23121
1: 320 H
1: 321 H
TESTING FOR NONSTATIONARITY
23
01: 320 H
01: 321 H
tttt
tttt
ttttt
ttttt
XXXXXX
XXXXXXXX
)()1()1(
)1()1(
2131321
23131321
231313121
231211
Combine the second and third terms on the right side.
tttt XXX 23121
1: 320 H
1: 321 H
TESTING FOR NONSTATIONARITY
24
01: 320 H
01: 321 H
tttt
tttt
ttttt
ttttt
XXXXXX
XXXXXXXX
)()1()1(
)1()1(
2131321
23131321
231313121
231211
Combine the terms with common factor 3.
tttt XXX 23121
1: 320 H
1: 321 H
TESTING FOR NONSTATIONARITY
25
Regress Xt on Xt–1 and Xt–1, and perform a t test on the coefficient of Xt–1. Note that if the null hypothesis is true, and the process is nonstationary, the conventional critical values of t will be invalid. We will need to use different ones that are valid under the null hypothesis.
01: 320 H
01: 321 H
tttt
tttt
ttttt
ttttt
XXXXXX
XXXXXXXX
)()1()1(
)1()1(
2131321
23131321
231313121
231211
tttt XXX 131321 )1(
TESTING FOR NONSTATIONARITY
26
By adding a time trend, and performing a t test on its coefficient, the model can be extended to test for deterministic nonstationarity as well.
tttt tXXX 423121
tttt tXXX 4131321 )1(
TESTING FOR NONSTATIONARITY
27
Here is the logarithmic series for expenditure on housing in the Demand Functions data set. It is clearly nonstationary, but nevertheless we will perform a formal test.
LGHOUS
5.0
5.5
6.0
6.5
7.0
7.5
1959 1963 1967 1971 1975 1979 1983 1987 1991 1995 1999 2003
LGHOUS
TESTING FOR NONSTATIONARITY
28
In EViews you can perform a test of nonstationarity by clicking on the name of the series to be tested, clicking on the View tab in the window that opens, and then clicking on Unit Root Test on the menu that appears.
5.0
5.5
6.0
6.5
7.0
7.5
1959 1963 1967 1971 1975 1979 1983 1987 1991 1995 1999 2003
Augmented Dickey-Fuller Unit Root Test on LGHOUS============================================================ t-Statistic Prob.* ============================================================Augmented Dickey-Fuller test statistic -1.691709 0.7378 Test critical values1% level -4.186481 5% level -3.518090 10% level -3.189732 ============================================================*MacKinnon (1996) one-sided p-values. Augmented Dickey-Fuller Test Equation Dependent Variable: D(LGHOUS) Method: Least Squares Sample(adjusted): 1961 2003 ============================================================ Variable Coefficient Std. Error t-Statistic Prob. ============================================================ LGHOUS(-1) -0.034904 0.020632 -1.691709 0.0987 D(LGHOUS(-1)) 0.274772 0.149339 1.839923 0.0734 C 0.232945 0.117491 1.982662 0.0545 @TREND(1959) 0.000576 0.000672 0.855999 0.3972============================================================
TESTING FOR NONSTATIONARITY
29
The slide shows the most important part of the output for the test for LGHOUS.
Augmented Dickey-Fuller Unit Root Test on LGHOUS============================================================ t-Statistic Prob.* ============================================================Augmented Dickey-Fuller test statistic -1.691709 0.7378 Test critical values1% level -4.186481 5% level -3.518090 10% level -3.189732 ============================================================Dependent Variable: D(LGHOUS) ============================================================ Variable Coefficient Std. Error t-Statistic Prob. ============================================================ LGHOUS(-1) -0.034904 0.020632 -1.691709 0.0987 D(LGHOUS(-1)) 0.274772 0.149339 1.839923 0.0734 C 0.232945 0.117491 1.982662 0.0545 @TREND(1959) 0.000576 0.000672 0.855999 0.3972============================================================
TESTING FOR NONSTATIONARITY
30
tttt tXXX 4113132 )1(
You can see that Xt has been regressed on Xt–1, Xt–1, and a trend.
Augmented Dickey-Fuller Unit Root Test on LGHOUS============================================================ t-Statistic Prob.* ============================================================Augmented Dickey-Fuller test statistic -1.691709 0.7378 Test critical values1% level -4.186481 5% level -3.518090 10% level -3.189732 ============================================================Dependent Variable: D(LGHOUS) ============================================================ Variable Coefficient Std. Error t-Statistic Prob. ============================================================ LGHOUS(-1) -0.034904 0.020632 -1.691709 0.0987 D(LGHOUS(-1)) 0.274772 0.149339 1.839923 0.0734 C 0.232945 0.117491 1.982662 0.0545 @TREND(1959) 0.000576 0.000672 0.855999 0.3972============================================================
TESTING FOR NONSTATIONARITY
31
tttt tXXX 4113132 )1(
The key items are the coefficient of Xt–1, here LGHOUS(–1), and its t statistic. The coefficient is close to 0, as it would be under the null hypothesis of nonstationarity.
Augmented Dickey-Fuller Unit Root Test on LGHOUS============================================================ t-Statistic Prob.* ============================================================Augmented Dickey-Fuller test statistic -1.691709 0.7378 Test critical values1% level -4.186481 5% level -3.518090 10% level -3.189732 ============================================================Dependent Variable: D(LGHOUS) ============================================================ Variable Coefficient Std. Error t-Statistic Prob. ============================================================ LGHOUS(-1) -0.034904 0.020632 -1.691709 0.0987 D(LGHOUS(-1)) 0.274772 0.149339 1.839923 0.0734 C 0.232945 0.117491 1.982662 0.0545 @TREND(1959) 0.000576 0.000672 0.855999 0.3972============================================================
TESTING FOR NONSTATIONARITY
32
tttt tXXX 4113132 )1(
The t statistic is reproduced at the top of the output, where it is described as the Augmented Dickey–Fuller test statistic.
Augmented Dickey-Fuller Unit Root Test on LGHOUS============================================================ t-Statistic Prob.* ============================================================Augmented Dickey-Fuller test statistic -1.691709 0.7378 Test critical values1% level -4.186481 5% level -3.518090 10% level -3.189732 ============================================================Dependent Variable: D(LGHOUS) ============================================================ Variable Coefficient Std. Error t-Statistic Prob. ============================================================ LGHOUS(-1) -0.034904 0.020632 -1.691709 0.0987 D(LGHOUS(-1)) 0.274772 0.149339 1.839923 0.0734 C 0.232945 0.117491 1.982662 0.0545 @TREND(1959) 0.000576 0.000672 0.855999 0.3972============================================================
TESTING FOR NONSTATIONARITY
33
tttt tXXX 4113132 )1(
EViews calculates the critical values for you. In this case you would not reject the null hypothesis that LGHOUS is a nonstationary series. The test result thus corroborates the conclusion we drew looking at the graph.
TESTING FOR NONSTATIONARITY
34
Here is the series for the first differences in the logarithm of expenditure on housing. Does it look stationary or nonstationary?
D(LGHOUS)
0.00
0.01
0.02
0.03
0.04
0.05
0.06
1959 1963 1967 1971 1975 1979 1983 1987 1991 1995 1999 2003
TESTING FOR NONSTATIONARITY
35
The differenced logarithms of a series give the proportional changes in each period. It looks as if the average growth rate has fallen from about 5 percent per year in the first half of the period to about 2.5 percent in the second half.
D(LGHOUS)
0.00
0.01
0.02
0.03
0.04
0.05
0.06
1959 1963 1967 1971 1975 1979 1983 1987 1991 1995 1999 2003
Augmented Dickey-Fuller Unit Root Test on DLGHOUS============================================================ t-Statistic Prob.* ============================================================Augmented Dickey-Fuller test statistic -4.518902 0.0042 Test critical values1% level -4.192337 5% level -3.520787 10% level -3.191277 ============================================================Dependent Variable: D(DLGHOUS) ============================================================ Variable Coefficient Std. Error t-Statistic Prob.============================================================ DLGHOUS(-1) -0.833121 0.184363 -4.518902 0.0001 D(DLGHOUS(-1)) 0.232715 0.161176 1.443855 0.1570 C 0.043288 0.010121 4.277022 0.0001 @TREND(1959) -0.000668 0.000181 -3.691100 0.0007============================================================
TESTING FOR NONSTATIONARITY
36
However, the coefficient is far from 0 and it has a high t statistic. We can reject the null hypothesis of nonstationarity at the 1 percent level.
Augmented Dickey-Fuller Unit Root Test on DLGHOUS============================================================ t-Statistic Prob.* ============================================================Augmented Dickey-Fuller test statistic -4.518902 0.0042 Test critical values1% level -4.192337 5% level -3.520787 10% level -3.191277 ============================================================Dependent Variable: D(DLGHOUS) ============================================================ Variable Coefficient Std. Error t-Statistic Prob.============================================================ DLGHOUS(-1) -0.833121 0.184363 -4.518902 0.0001 D(DLGHOUS(-1)) 0.232715 0.161176 1.443855 0.1570 C 0.043288 0.010121 4.277022 0.0001 @TREND(1959) -0.000668 0.000181 -3.691100 0.0007============================================================
TESTING FOR NONSTATIONARITY
37
Thus it would appear that LGHOUS can be rendered stationary by differencing once. It would therefore be described as I(1). (Short for integrated of order 1.)
LGDPI
TESTING FOR NONSTATIONARITY
38
Here is the logarithmic series for income. It is also clearly nonstationary.
7.0
7.5
8.0
8.5
9.0
9.5
1959 1963 1967 1971 1975 1979 1983 1987 1991 1995 1999 2003
TESTING FOR NONSTATIONARITY
39
The coefficient is small with a low t statistic, giving support to the null hypothesis of nonstationarity.
Augmented Dickey-Fuller Unit Root Test on LGDPI============================================================ t-Statistic Prob.* ============================================================Augmented Dickey-Fuller test statistic -2.322310 0.4134 Test critical values1% level -4.186481 5% level -3.518090 10% level -3.189732 ============================================================Dependent Variable: D(LGDPI) ============================================================ Variable Coefficient Std. Error t-Statistic Prob.============================================================ LGDPI(-1) -0.120908 0.052064 -2.322310 0.0255 D(LGDPI(-1)) 0.107910 0.147515 0.731520 0.4688 C 0.947906 0.390441 2.427787 0.0199 @TREND(1959) 0.003580 0.001737 2.061228 0.0460============================================================
D(LGDPI)
TESTING FOR NONSTATIONARITY
40
Here is the series for the first differences in the logarithm of income. It looks stationary.
-0.01
0
0.01
0.02
0.03
0.04
0.05
0.06
0.07
0.08
1959 1963 1967 1971 1975 1979 1983 1987 1991 1995 1999 2003
Augmented Dickey-Fuller Unit Root Test on DLGDPI============================================================ t-Statistic Prob.* ============================================================Augmented Dickey-Fuller test statistic -4.125167 0.0119 Test critical values1% level -4.192337 5% level -3.520787 10% level -3.191277 ============================================================Dependent Variable: D(DLGDPI) ============================================================ Variable Coefficient Std. Error t-Statistic Prob. ============================================================ DLGDPI(-1) -0.892399 0.216330 -4.125167 0.0002 D(DLGDPI(-1)) -0.045015 0.158840 -0.283400 0.7784 C 0.041368 0.011109 3.723927 0.0006 @TREND(1959) -0.000453 0.000225 -2.007941 0.0518============================================================
TESTING FOR NONSTATIONARITY
41
The coefficient is now a long way from 0. The t statistic is significant at the 5 percent level but not quite significant at the 1 percent level..
Augmented Dickey-Fuller Unit Root Test on DLGDPI============================================================ t-Statistic Prob.* ============================================================Augmented Dickey-Fuller test statistic -4.125167 0.0119 Test critical values1% level -4.192337 5% level -3.520787 10% level -3.191277 ============================================================Dependent Variable: D(DLGDPI) ============================================================ Variable Coefficient Std. Error t-Statistic Prob. ============================================================ DLGDPI(-1) -0.892399 0.216330 -4.125167 0.0002 D(DLGDPI(-1)) -0.045015 0.158840 -0.283400 0.7784 C 0.041368 0.011109 3.723927 0.0006 @TREND(1959) -0.000453 0.000225 -2.007941 0.0518============================================================
TESTING FOR NONSTATIONARITY
42
One of the problems with the ADF and similar tests is that they appear to be weak in terms of power. Often one is unable to reject the null hypothesis of nonstationarity, even when there is good reason to believe that it is incorrect.
Augmented Dickey-Fuller Unit Root Test on DLGDPI============================================================ t-Statistic Prob.* ============================================================Augmented Dickey-Fuller test statistic -4.125167 0.0119 Test critical values1% level -4.192337 5% level -3.520787 10% level -3.191277 ============================================================Dependent Variable: D(DLGDPI) ============================================================ Variable Coefficient Std. Error t-Statistic Prob. ============================================================ DLGDPI(-1) -0.892399 0.216330 -4.125167 0.0002 D(DLGDPI(-1)) -0.045015 0.158840 -0.283400 0.7784 C 0.041368 0.011109 3.723927 0.0006 @TREND(1959) -0.000453 0.000225 -2.007941 0.0518============================================================
TESTING FOR NONSTATIONARITY
43
In this case, given the large size of the coefficient, –0.89, it would be reasonable to suppose that the series is stationary.
LGPRHOUS
TESTING FOR NONSTATIONARITY
44
Finally we will look at the logarithmic series for the price index. It is so flat that we have to use a large scale to see anything at all. Stationary or nonstationary?
4.2
4.3
4.4
4.5
4.6
4.7
1959 1963 1967 1971 1975 1979 1983 1987 1991 1995 1999 2003
LGPRHOUS
TESTING FOR NONSTATIONARITY
45
4.2
4.3
4.4
4.5
4.6
4.7
1959 1963 1967 1971 1975 1979 1983 1987 1991 1995 1999 2003
Hard to call. It could be a stationary process with a very high degree of autocorrelation, or it could be a random walk.
Augmented Dickey-Fuller Unit Root Test on LGPRHOUS============================================================ t-Statistic Prob.* ============================================================Augmented Dickey-Fuller test statistic -1.420016 0.8408 Test critical values1% level -4.186481 5% level -3.518090 10% level -3.189732 ============================================================Dependent Variable: D(LGPRHOUS) ============================================================ Variable Coefficient Std. Error t-Statistic Prob. ============================================================ LGPRHOUS(-1) -0.048259 0.033985 -1.420016 0.1635 D(LGPRHOUS(-1)) 0.504742 0.140567 3.590749 0.0009 C 0.209124 0.150738 1.387337 0.1732 @TREND(1959) 0.000410 0.000189 2.170909 0.0361============================================================
TESTING FOR NONSTATIONARITY
46
The coefficient is close to 0 and the t statistic is small. We do not reject the null hypothesis of nonstationarity.
D(LGPRHOUS)
TESTING FOR NONSTATIONARITY
47
Here are the first differences. This series looks stationary.
-0.08
-0.06
-0.04
-0.02
0
0.02
0.04
1959 1963 1967 1971 1975 1979 1983 1987 1991 1995 1999 2003
Augmented Dickey-Fuller Unit Root Test on DPHOUS============================================================ t-Statistic Prob.* ============================================================Augmented Dickey-Fuller test statistic -4.611691 0.0033 Test critical values1% level -4.192337 5% level -3.520787 10% level -3.191277 ============================================================Dependent Variable: D(DPHOUS) ============================================================ Variable Coefficient Std. Error t-Statistic Prob. ============================================================ DPHOUS(-1) -0.720856 0.156311 -4.611691 0.0000 D(DPHOUS(-1)) 0.349962 0.153860 2.274546 0.0287 C -0.007368 0.004294 -1.716005 0.0943 @TREND(1959) 0.000407 0.000174 2.335997 0.0249 ============================================================
TESTING FOR NONSTATIONARITY
48
The t statistic allows us to reject the null hypothesis of nonstationarity at the 1 percent level. We therefore conclude that the logarithmic price series appears to be I(1).
Copyright Christopher Dougherty 2000–2006. This slideshow may be freely copied for personal use.
01.03.06