Professional Documents
Culture Documents
Topic 8 Introduction To The Advanced Time Series Model
Topic 8 Introduction To The Advanced Time Series Model
http://rizaudinsahlan.blogspot.my
RIZAUDIN SAHLAN 1
8.1 TESTING FOR UNIT ROOTS
• We now turn to important problem of testing whether a TS
follows a unit root process.
• We had discussed in Topic 2 informal guidelines to decide
whether a series is I(1) or not.
• It is useful to have a formal test for unit root.
• The simplest approach testing unit root begins with AR(1)
model;
𝑦𝑡 = 𝛼 + 𝜌𝑦𝑡−1 + 𝑒𝑡 (8.1.1)
RIZAUDIN SAHLAN 3
8.1 TESTING FOR UNIT ROOTS
• When 𝜌 < 1, 𝑦𝑡 is stable AR(1) process, which means it is
weakly dependent or asymptotic uncorrelated.
• Therefore, testing (8.1.3) to model (8.1.1), with alternative
hypothesis given (8.1.4) is really a test whether 𝑦𝑡 is I(1)
against the alternative that 𝑦𝑡 is I(0).
• The convenient equation for carrying out the unit root test is
to substract 𝑦𝑡−1 from both sides of (8.1.1) and define
𝜃 = 𝜌 − 1;
𝑦𝑡 − 𝑦𝑡−1 = 𝛼 + 𝜌𝑦𝑡−1 − 𝑦𝑡−1 + 𝑒𝑡
𝑦𝑡 − 𝑦𝑡−1 = 𝛼 + (𝜌 − 1)𝑦𝑡−1 + 𝑒𝑡
∆𝑦𝑡 = 𝛼 + 𝜃𝑦𝑡−1 + 𝑒𝑡 (8.1.5)
RIZAUDIN SAHLAN 4
8.1 TESTING FOR UNIT ROOTS
• Eq(8.5) seems straightforward to test ;
𝐻0 : 𝜃 = 0 against 𝐻1 : 𝜃 < 0
RIZAUDIN SAHLAN 5
8.1 TESTING FOR UNIT ROOTS
• Means that we can use the value of 𝑡 statistics (or 𝜏𝑠 )from
regression in (8.1.5), but we will used the table (distribution)
tabulated by Dickey and Fuller to get the critical value 𝜏𝑐 .
• The resulting test for (8.1.5) is known as Dickey-Fuller (DF)
test for a unit root.
RIZAUDIN SAHLAN 8
8.1 TESTING FOR UNIT ROOTS
∆𝑟3𝑡 = 𝛼 + 𝜃𝑟3𝑡−1 + 𝑢𝑡
RIZAUDIN SAHLAN 9
8.1 TESTING FOR UNIT ROOTS
r3
L1. -.0907106 .0366782 -2.47 0.015 -.1633247 -.0180965
RIZAUDIN SAHLAN 10
8.1 TESTING FOR UNIT ROOTS
• The value of 𝜃 = −0.09 and the value of 𝜏𝑠 = −2.47.
• If we choose the significance level 0.05 with 𝑛 = 100, the
critical value from Table D.7 is 𝜏𝑐 = −2.89
• Because the 𝜏𝑠 > 𝜏𝑐 , therefore, we fail to reject 𝐻0 : 𝜃 = 0
againts 𝐻𝑎 : 𝜃 < 0 .
• That means, the time series of three-month T-bills have a unit
root, or non-stationary in level form
• When we fail to reject a unit root, we should only conclude
that the data do not provide strong evidence againts 𝐻0 .
RIZAUDIN SAHLAN 11
8.1 TESTING FOR UNIT ROOTS
• Because the series is non-stationary in level form, we must
difference the data to make the series become stationary.
• To make the first difference for series;
∆2 𝑟3𝑡 = 𝛼 + 𝜃∆𝑟3𝑡−1 + 𝑢𝑡
where ∆2 𝑟3𝑡 = ∆𝑟3𝑡 − ∆𝑟3𝑡−1
r3
LD. -1.115726 .0906975 -12.30 0.000 -1.295301 -.9361516
RIZAUDIN SAHLAN 12
8.1 TESTING FOR UNIT ROOTS
• The value of 𝜃 = −1.11 and the value of 𝜏𝑠 = −12.30.
• If we choose the significance level 0.05 with 𝑛 = 100, the
critical value from Table D.7 is 𝜏𝑐 = −2.89
• Because the 𝜏𝑠 < 𝜏𝑐 , therefore, we reject 𝐻0 : 𝜃 = 0 againts
𝐻𝑎 : 𝜃 < 0 .
• That means, the time series of three-month T-bills in first
difference not have a unit root, or stationary and we can say
that the series of 𝑟3 is integrated at 𝐼 1 , or 𝑟3~𝐼(1).
RIZAUDIN SAHLAN 13
8.1 TESTING FOR UNIT ROOTS
• We also need to test for unit roots in models with more
complicated dynamics.
• If 𝑦𝑡 follows (8.1.1) with 𝜌 = 1, then ∆𝑦𝑡 will make 𝑦 serially
uncorrelated.
• We can allow ∆𝑦𝑡 to follow an AR model by augmenting
(8.1.5) with additional lags;
where 𝛾1 < 1.
• This ensure that, under 𝐻0 : 𝜃 = 0, ∆𝑦𝑡 follows a stable
AR(1) model.
RIZAUDIN SAHLAN 14
8.1 TESTING FOR UNIT ROOTS
• Generally, we can add 𝑝 lags on ∆𝑦𝑡 to the equation to
account for the dynamic in the process;
𝑝
∆𝑦𝑡 = 𝛼 + 𝜃𝑦𝑡−1 + 𝛾𝑖 𝑖=1 ∆𝑦𝑡−𝑖 + 𝑒𝑡 (8.1.7)
RIZAUDIN SAHLAN 15
8.1 TESTING FOR UNIT ROOTS
• The critical value and rejection rule are the same as before.
• The inclusion of the lagged changes in (8.1.7) is intended to
clean up any serial correlated in ∆𝑦𝑡 .
• The more lags we include, the more initial obs we lose.
RIZAUDIN SAHLAN 16
8.1 TESTING FOR UNIT ROOTS
inf
L1. -.3103252 .1027077 -3.02 0.004 -.517319 -.1033315
LD. .1383615 .1264026 1.09 0.280 -.1163861 .3931091
RIZAUDIN SAHLAN 17
8.1 TESTING FOR UNIT ROOTS
• The value of 𝜃 = −0.310 and the value of 𝜏𝑠 = −3.02.
• If we choose the significance level 0.05 with 𝑛 = 50, the
critical value from Table D.7 is 𝜏𝑐 = −2.93
• Because the 𝜏𝑠 < 𝜏𝑐 , therefore, we successfully reject
𝐻0 : 𝜃 = 0 againts 𝐻𝑎 : 𝜃 < 0 .
• That means, the time series of inflation in level form not have
a unit root, or stationary, 𝑖𝑛𝑓~𝐼(0).
• Alternatively, we also can use the command provided by Stata
to perform the ADF test, dfuller.
RIZAUDIN SAHLAN 18
8.1 TESTING FOR UNIT ROOTS
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
RIZAUDIN SAHLAN 19
8.1 TESTING FOR UNIT ROOTS
• For series that have clear time trends, we need to modify the
test for unit root.
• If we carry out the usual DF or ADF test on a trending but I(0)
series, we probably have little power for rejecting a unit root.
• To allow for series with time trends, we can change the basic
equation to
RIZAUDIN SAHLAN 20
8.1 TESTING FOR UNIT ROOTS
• If 𝑦𝑡 has a unit root, then ∆𝑦𝑡 = 𝛼 + 𝛿𝑡 + 𝑒𝑡 , as so the change
in 𝑦𝑡 has a mean linear in 𝑡 unless 𝛿 = 0.
• When we include a time trend in the regression, the critical
values 𝜏𝑐 of the test change.
• Intuitively, this occurs because detrending a unit root process
tends to make it look more like an I(0) process.
• Therefore, we require a larger magnitude for the 𝜏-statistics in
order to reject 𝐻0 .
• The DF critical value for the 𝜏-test that includes a time time
trend are also given in Table D.7.
RIZAUDIN SAHLAN 21
8.1 TESTING FOR UNIT ROOTS
Example : Unit root in the log of U.S Real Gross Domestic Product
• We apply the unit root test with time trend to the U.S. GDP
data in INVEN.dta.
• This annual data cover the years from 1959 through 1995.
• We test whether log 𝐺𝐷𝑃𝑡 has a unit root (ADF test);
RIZAUDIN SAHLAN 22
8.1 TESTING FOR UNIT ROOTS
7000
6000
GDP, billions '92 $
5000
4000
3000
2000
RIZAUDIN SAHLAN 23
8.1 TESTING FOR UNIT ROOTS
. tsset year
time variable: year, 1959 to 1995
delta: 1 unit
. gen lgdp=log(gdp)
lgdp
L1. -.2096203 .0865941 -2.42 0.022 -.3862301 -.0330104
LD. .2637479 .1647397 1.60 0.120 -.0722409 .5997367
RIZAUDIN SAHLAN 24
8.1 TESTING FOR UNIT ROOTS
• The value of 𝜃 = −0.210 and the value of 𝜏𝑠 = −2.42.
• If we choose the significance level 0.05 with 𝑛 = 50, the
critical value from Table D.7 (with trend) is 𝜏𝑐 = −3.50
• Because the 𝜏𝑠 > 𝜏𝑐 , therefore, we fail to reject 𝐻0 : 𝜃 = 0
againts 𝐻𝑎 : 𝜃 < 0 .
• That means, the time series of log GDP in level form have a
unit root, or non-stationary.
• Because the series of 𝑙𝑔𝑑𝑝 is non-stationary at level form, the
series must be difference until its stationary.
RIZAUDIN SAHLAN 25
8.1 TESTING FOR UNIT ROOTS
• The ADF test for 𝑙𝑔𝑑𝑝 in first difference;
lgdp
LD. -1.111196 .2192083 -5.07 0.000 -1.558879 -.6635132
LD2. .3070998 .1697173 1.81 0.080 -.0395092 .6537087
RIZAUDIN SAHLAN 26
8.1 TESTING FOR UNIT ROOTS
• The value of 𝜃 = −0.111 and the value of 𝜏𝑠 = −5.07.
• If we choose the significance level 0.05 with 𝑛 = 50, the
critical value from Table D.7 (with trend) is 𝜏𝑐 = −3.50
• Because the 𝜏𝑠 < 𝜏𝑐 , therefore, we reject 𝐻0 : 𝜌 = 1 againts
𝐻𝑎 : 𝜌 < 1 , or 𝐻0 : 𝜃 = 0 againts 𝐻𝑎 : 𝜃 < 0 .
• That means, the time series of log GDP in first difference not
have a unit root, or stationary, 𝑙𝑔𝑑𝑝~𝐼 1 .
• Alternatively, we also can use the command provided by Stata
to perform the ADF test, dfuller.
RIZAUDIN SAHLAN 27
8.1 TESTING FOR UNIT ROOTS
Level Form:
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
First Difference:
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
RIZAUDIN SAHLAN 28
8.2 SPURIOUS REGRESSION
• In cross-sectional context, we use phrase “spurious
correlation” to describe where two variable are related
through their correlation with third variable.
• If we regress 𝑦 on 𝑥, we find a significant relationship.
• But, when we control for another variable, say 𝑧, the partial
effect of 𝑥 on 𝑦 become zero.
• Naturally, this can also happen in TS context with non-
stationary variables.
• It is possible to find a spurious relationship between TS that
have increasing or decreasing trend.
• If the series are weakly dependent about their time trends,
the problem is effectively solved by including a time trend in
the regression model.
RIZAUDIN SAHLAN 29
8.2 SPURIOUS REGRESSION
• Let 𝑥𝑡 and 𝑦𝑡 be random walks generated by
𝑥𝑡 = 𝑥𝑡−1 + 𝑢𝑡 (8.2.1)
and
𝑦𝑡 = 𝑦𝑡−1 + 𝑒𝑡 (8.2.2)
𝑦𝑡 = 𝛽0 + 𝛽1 𝑥𝑡 (8.2.3)
RIZAUDIN SAHLAN 30
8.2 SPURIOUS REGRESSION
and obtained the usual 𝑡 statistics for 𝛽1 and the usual 𝑅-
squared?
• Because 𝑦𝑡 and 𝑥𝑡 are independent, we would hope that
𝑝𝑙𝑖𝑚 𝛽1 = 0.
• Or, if we test 𝐻0 : 𝛽0 = 0 against 𝐻1 : 𝛽0 ≠ 0 , we hope that the
𝑡-statistic for 𝛽1 is insignificant .
• But, the study by Granger and Newbold (1974) through
simulation showed that this is not the case: even the 𝑦𝑡 and
𝑥𝑡 are independent.
• The regression of 𝑦𝑡 on 𝑥𝑡 yields a statistical significant 𝑡-
statistics.
• Granger and Newbold called this is the spurious regression
problem : there is no sense in which 𝑦 and 𝑥 are related, but
an OLS regression using 𝑡-statistics
RIZAUDIN SAHLAN
indicate relationship. 31
8.2 SPURIOUS REGRESSION
• Including a time trend does not really change the conclusion .
• If 𝑦𝑡 or 𝑥𝑡 is a random walk with drift and the time trend not
included, the spurious regression problem is even worse.
• The possibility of spurious regression with I(1) variable is quite
important and has led economist to reexamine many
aggregate TS regression whose 𝑡 statistics were very
significant and whose 𝑅-squared were extremely high.
• In the next section, we show that regressing an I(1)
dependent variable on an I(1) independent variable can be
informative, but only if these variables are related in a precise
sense.
RIZAUDIN SAHLAN 32
8.2 SPURIOUS REGRESSION
• Now, lets we looks the meaning of spurious regression with
the data generating process (DGP) for equation (8.2.1) and
(8.2.2).
• We generate 500 obs of 𝑒𝑥𝑡 from 𝑒𝑥𝑡 ~𝑁 0,1 and 500 obs of
𝑒𝑦𝑡 from 𝑒𝑦𝑡 ~𝑁 0,1 and assume that the initial value of both
𝑥 and 𝑦 are zero.
RIZAUDIN SAHLAN 33
8.2 SPURIOUS REGRESSION
. * generate the obs
. set obs 500
number of observations (_N) was 0, now 500
. gen t=_n
. tsset t
time variable: t, 1 to 500
delta: 1 unit
. gen ey=rnormal(0,1)
. * generate series x
. gen x=0
. * generate series y
. gen y=0
RIZAUDIN SAHLAN 34
8.2 SPURIOUS REGRESSION
. tsline y x, title("Random Walk Model")
y x
RIZAUDIN SAHLAN 35
8.2 SPURIOUS REGRESSION
• Lets we perform the unit root test these series;
ADF test on 𝑥 in level form
Augmented Dickey-Fuller test for unit root Number of obs = 498
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
RIZAUDIN SAHLAN 37
8.2 SPURIOUS REGRESSION
• Both the series is now stationary at first difference, or 𝑥𝑡 ~(1)
and 𝑦𝑡 ~(1) .
• Now, we regress 𝑦𝑡 on 𝑥𝑡 in level form by OLS ;
𝑦𝑡 = 𝛽0 + 𝛽1 𝑥𝑡 + 𝑢𝑡
. reg y x
. estat dwatson
RIZAUDIN SAHLAN 38
8.2 SPURIOUS REGRESSION
• The results show that the coefficients of 𝑥𝑡 is highly
statistically significance and although the 𝑅2 value is low, its
statistically significantly different from zero.
• From this results, we may tempted to concluded that there is
a significant statistical relationship between 𝑥 and 𝑦, whereas
a priori there should be none.
• This is nutshell the phenomenon of spurious or nonsense
regression first discovered by Yule (1926).
• Yule show that spurious correlation could persist in
nonstationary time series even the sample is large.
• According to Granger and Newbold (1974), an 𝑅2 > 𝑑 is a
good rule of thumb to suspect that the estimated regression is
spurious.
RIZAUDIN SAHLAN 39
8.3 COINTEGRATION
• The discussion of spurious regression in the previous section
certainly makes one wary of using the levels of variables
which is non-stationary in regression analysis.
• We suggested that non-stationary variable should be
differenced and stationary before they can used in linear
regression models.
RIZAUDIN SAHLAN 40
8.3 COINTEGRATION
RIZAUDIN SAHLAN 41
8.3 COINTEGRATION
• If 𝑦𝑡 : 𝑡 = 0,1, … and 𝑥𝑡 : 𝑡 = 0,1, … are two I(1) processes,
then, in general 𝑦𝑡 − 𝛽𝑥𝑡 is an I(1) process for any number of
𝛽.
• It also possible that for some 𝛽 ≠ 0, the 𝑦𝑡 − 𝛽𝑥𝑡 is an I(0)
process which means it has constant mean, constant variance
and autocorrelation that depends only on time distance
between any two variables in the series, and its
asymptotically uncorrelated.
• If such a 𝛽 exists, we say that 𝑦 and 𝑥 cointegrated, and 𝛽 is
cointegration parameter.
RIZAUDIN SAHLAN 42
8.3 COINTEGRATION
• For illustration, assume 𝛽 = 1 and 𝑦0 = 𝑥0 = 0.
• We write
𝑦𝑡 = 𝑦𝑡−1 + 𝑟𝑡 , (8.3.1)
𝑥𝑡 = 𝑥𝑡−1 + 𝑣𝑡 , (8.3.2)
where 𝑟𝑡 and 𝑣𝑡 are two I(0) processes with zero means.
RIZAUDIN SAHLAN 43
8.3 COINTEGRATION
RIZAUDIN SAHLAN 44
8.3 COINTEGRATION
ADF test in level form for 𝑟3
Augmented Dickey-Fuller test for unit root Number of obs = 122
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
RIZAUDIN SAHLAN 45
8.3 COINTEGRATION
• We found a evidence that both 𝑟3 and 𝑟6 has a unit root or
non-stationary in level form.
• Now, lets we perform the unit root again but with in first
difference.
RIZAUDIN SAHLAN 46
8.3 COINTEGRATION
ADF test in first difference form for 𝑟3
Augmented Dickey-Fuller test for unit root Number of obs = 121
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
RIZAUDIN SAHLAN 47
8.3 COINTEGRATION
• Now, we found a evidence that both 𝑟3 and 𝑟6 has a unit
root in level form but stationary at first difference, 𝑟3~𝐼(1)
and 𝑟6~𝐼(1) .
• Lets we define the gap between six- and three-month T-bill
rates as;
𝑠𝑝𝑟𝑡 = 𝑟6𝑡 − 𝑟3𝑡
∆𝑠𝑝𝑟𝑡 = 𝛼 + 𝜃𝑠𝑝𝑟𝑡−1 + 𝑒𝑡
RIZAUDIN SAHLAN 48
8.3 COINTEGRATION
ADF test in level form for 𝑠𝑝𝑟
. gen spr=r6-r3
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
RIZAUDIN SAHLAN 49
8.3 COINTEGRATION
20
15
10
5
0
0 50 100 150
time
RIZAUDIN SAHLAN 50
8.3 COINTEGRATION
• The results show that the time series of 𝑠𝑝𝑟 in level form not
have a unit root, or stationary, I(0).
• The upshot of this is that though 𝑟6𝑡 and 𝑟3𝑡 each appear to
be unit root processes in level form, the difference between
them is an I(0) process.
• In other words, 𝑟6 and 𝑟3 are cointegrated.
RIZAUDIN SAHLAN 51
8.3 COINTEGRATION
• Cointegration in this example, as in many example, has
economic interpretation.
• If 𝑟6 and 𝑟3 were not cointegrated, the gap between interest
rate could become very large, with no tendency for them to
come back together.
• From simple arbitrage argument, this seem unlikely.
• Supposed that the spread 𝑠𝑝𝑟𝑡 continues to grow for several
time period – making six-month T-bill much more desirable
investment.
• Then, investor will shift away from three-month T-bill and
toward six-month T-bills.
• Because interest rates are inversely related to price, this
would lower 𝑟6 and increase 𝑟3, until the spread is reduced.
RIZAUDIN SAHLAN 52
8.3 COINTEGRATION
• Therefore, large deviation between 𝑟6 and 𝑟3 are not
expected to continue: the spread has a tendency to return to
its mean value.
RIZAUDIN SAHLAN 53
8.3 COINTEGRATION
• If we reject a unit root in 𝑠𝑡 , then find that 𝑦𝑡 and 𝑥𝑡 are
cointegrated.
• In other words, the null hypothesis is that 𝑦𝑡 and 𝑥𝑡 are not
cointegrated.
is consistent for 𝛽.
RIZAUDIN SAHLAN 54
8.3 COINTEGRATION
• The problem is that the null hypothesis state that two series
are not cointegrated, which means under 𝐻0 we running a
spurious regression.
• It’s possible to tabulate critical values even when 𝛽 is
estimated, we apply the DF or ADF test on residual from
Eq(8.3.4);
𝑢𝑡 = 𝑦𝑡 − 𝛽𝑥𝑡 (8.3.5)
• Perform the DF or ADF test and then get the resulting test is
called the Engle-Granger(EG) test an the asymptotic critical
values are given in Table 18.4.
• These are taken from Davidson and MacKinnon (1993,Table
20.2).
RIZAUDIN SAHLAN 55
8.3 COINTEGRATION
RIZAUDIN SAHLAN 56
8.3 COINTEGRATION
• In the basic test, we run;
RIZAUDIN SAHLAN 57
8.3 COINTEGRATION
• If 𝑦𝑡 and 𝑥𝑡 are not cointegrated, a regression of 𝑦𝑡 on 𝑥𝑡 is
spurious and tells us nothing meaningful: there is no long-run
relationship between 𝑥𝑡 and 𝑦𝑡 .
• For this case, we can still run a regression involving the first
differences, ∆𝑦𝑡 and ∆𝑥𝑡 , including lags.
• But we should interpret these regressions for what they are:
they explain the difference in 𝑦 in terms of the difference in 𝑥
and have nothing necessarily to do with relationship in levels.
RIZAUDIN SAHLAN 58
8.3 COINTEGRATION
RIZAUDIN SAHLAN 59
8.3 COINTEGRATION
RIZAUDIN SAHLAN 60
8.3 COINTEGRATION
250
200
150
100
50
0
RIZAUDIN SAHLAN 61
8.3 COINTEGRATION
• Lets perform the ADF test in level form for 𝑔𝑓𝑟 and 𝑝𝑒 with 1
lags;
ADF test in level for 𝑔𝑓𝑟
Augmented Dickey-Fuller test for unit root Number of obs = 70
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
RIZAUDIN SAHLAN 62
8.3 COINTEGRATION
• The results show that for both variables, the 𝜏𝑠 > 𝜏𝑐 at 5%
significance level, which means the null hypothesis for unit
root is fail to rejected.
• This means that the 𝑔𝑓𝑟 and 𝑝𝑒 have a unit root or non-
stationary in level form.
RIZAUDIN SAHLAN 63
8.3 COINTEGRATION
• Now, lets perform the ADF test for 𝑔𝑓𝑟 and 𝑝𝑒 in first
difference with 1 lags;
ADF test in first difference for 𝑔𝑓𝑟
Augmented Dickey-Fuller test for unit root Number of obs = 69
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
RIZAUDIN SAHLAN 64
8.3 COINTEGRATION
RIZAUDIN SAHLAN 65
8.3 COINTEGRATION
RIZAUDIN SAHLAN 66
8.3 COINTEGRATION
. tsline uhat
20
0
Residuals
-20
-40
RIZAUDIN SAHLAN 67
8.3 COINTEGRATION
uhat
L1. -.0942049 .0486653 -1.94 0.057 -.1912895 .0028797
RIZAUDIN SAHLAN 68
8.3 COINTEGRATION
• The value of 𝜃 = −0.0942 and the value of 𝑡𝑠 = −1.94.
• If we choose the significance level 5%, the critical value from
Table C with 𝑇= 2 and three variables is 𝑡𝑐 = −3.915.
• Because the 𝑡𝑠 > 𝑡𝑐 , therefore we must concluded that there
is no evidence of cointegration between 𝑔𝑓𝑟 and 𝑝𝑒.
• It is very likely that the earlier regression results we obtained
in level form as in (8.3.7) is suffer from the spurious
regression problem.
• Alternatively, we also can use the command provided by Stata
to perform the EG test, egranger.
RIZAUDIN SAHLAN 69
8.3 COINTEGRATION
RIZAUDIN SAHLAN 70
8.4 ERROR CORRECTION MODEL
• In addition to learning about a potential long-run relationship
between two series, the concept of cointegration enriches the
kinds of dynamic models.
• If 𝑦𝑡 and 𝑥𝑡 are I(1) processes and are cointegrated, we might
estimate a dynamic model in first differences.
• Consider the equation;
where 𝑢𝑡 has zero mean given ∆𝑥𝑡 , ∆𝑦𝑡−1 , ∆𝑥𝑡−1 and further
lags.
RIZAUDIN SAHLAN 71
8.4 ERROR CORRECTION MODEL
• If 𝑦𝑡 and 𝑥𝑡 are cointegrated with parameter 𝛽, then we have
additional I(0) variables that we can include in (8.4.1).
• Let
𝐸𝐶𝑡 = 𝑦𝑡 − 𝛽𝑥𝑡
RIZAUDIN SAHLAN 72
8.4 ERROR CORRECTION MODEL
• The term 𝛿 𝑦𝑡−1 − 𝛽𝑥𝑡−1 is called the error correction term
and Eq(8.4.2) is an example of an error correction model
(ECM).
• The ECM allows us to study the short-run dynamics in the
relationship between 𝑦 and 𝑥.
• For simplicity, consider the model without lags of ∆𝑦𝑡 and ∆𝑥𝑡 ;
where 𝛿 < 0.
RIZAUDIN SAHLAN 73
8.4 ERROR CORRECTION MODEL
• If 𝑦𝑡−1 > 𝛽𝑥𝑡−1 , then 𝑦 in the previous period has overshoot
the equilibrium; the error correction term (ECT) works to push
𝑦 back toward the equilibrium.
• If 𝑦𝑡−1 < 𝛽𝑥𝑡−1 , the ECT induce a positive change in 𝑦 back
toward the equilibrium.
RIZAUDIN SAHLAN 74
8.4 ERROR CORRECTION MODEL
where;
𝑦6 = three-month holding yield (in percent)
𝑦3𝑡 = three month holding yield (in percent)
RIZAUDIN SAHLAN 75
8.4 ERROR CORRECTION MODEL
RIZAUDIN SAHLAN 76
8.4 ERROR CORRECTION MODEL
• It turns out that there is evidence of a unit root in 𝑦3 and
𝑦6. (both are I(1) processes)
ADF test with 1 lags on 𝑦6 at level form
Augmented Dickey-Fuller test for unit root Number of obs = 121
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
RIZAUDIN SAHLAN 78
8.4 ERROR CORRECTION MODEL
• The expectations hypothesis implies, at minimum, that 𝑦3𝑡
and 𝑦6𝑡 are cointegrated with 𝛽 equal to one.
• And then, we test for the cointegration for the estimated
residual;
𝑦6𝑡 = 𝛽0 + 𝛽1 𝑦3𝑡 + 𝑢𝑡
𝑢𝑡 = 𝑦6𝑡 − 𝛽0 − 𝛽1 𝑦3𝑡
∆𝑢𝑡 = 𝜃𝑢𝑡−1 + 𝜀𝑡
RIZAUDIN SAHLAN 79
8.4 ERROR CORRECTION MODEL
DF test for the residual in level form without constant;
Dickey-Fuller test for unit root Number of obs = 122
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
uhat
L1. -1.036268 .0908161 -11.41 0.000 -1.216062 -.8564734
• The results show that the 𝜏𝑠 is -11.411 and the critical value
from EG Table C for two variables and 5% significance level is
-3.398 which means null hypothesis is rejected and 𝑢𝑡 ~𝐼(0).
RIZAUDIN SAHLAN 80
8.4 ERROR CORRECTION MODEL
• Or, we use the command egranger for test cointegration;
Engle-Granger test for cointegration N (1st step) = 123
N (test) = 122
_egresid
L1. -1.036268 .0908161 -11.41 0.000 -1.216062 -.8564734
• Both test results show that the variables 𝑦6 and 𝑦3 is
cointegrated or there is a long-run relationship between
them. RIZAUDIN SAHLAN 81
8.4 ERROR CORRECTION MODEL
• The expectations hypothesis implies, at minimum, that 𝑦3𝑡
and 𝑦6𝑡 are cointegrated with 𝛽 equal to one.
• Under this assumption, an ECM can be written as below;
RIZAUDIN SAHLAN 82
8.4 ERROR CORRECTION MODEL
hy3
D1. -1.086571 .0504964 -21.52 0.000 -1.186559 -.9865829
uhat
L1. -.9540214 .0251293 -37.96 0.000 -1.00378 -.9042629
RIZAUDIN SAHLAN 83
8.4 ERROR CORRECTION MODEL
• The ECT is negative and very significance.
• Significance means that there is adjustment in the short-run
to make the model equilibrium in the long-run.
• If not significance, the model is already in equilibrium state
and no need the adjustment in short-run.
• For example, if the holding yield on six-month T-bills is above
that for three-month T-bills by one point, 𝑦6 falls by 0.950
points on average in the next quarter (𝑡).
RIZAUDIN SAHLAN 84
8.5 CAUSALITY IN ECONOMICS:
THE GRANGER CAUSALITY TEST
RIZAUDIN SAHLAN 86
8.5 CAUSALITY IN ECONOMICS:
THE GRANGER CAUSALITY TEST
• We now distinguish four cases;
• Unidirectional causality from M to GDP – estimated
coefficients on the lagged M in (8.5.1) are statistically
different from zero as a group 𝛼𝑖 ≠ 0 ; estimated
coefficients on the lagged GDP in (8.5.2) is not statistically
different from zero as a group 𝛿𝑖 = 0 .
RIZAUDIN SAHLAN 87
8.5 CAUSALITY IN ECONOMICS:
THE GRANGER CAUSALITY TEST
• Feedback, or bilateral causality, is suggested when the sets of
M and GDP coefficients are statistically significantly different
from zero in both regressions. 𝛼𝑖 ≠ 0 and 𝛿𝑖 ≠ 0 .
RIZAUDIN SAHLAN 88
8.5 CAUSALITY IN ECONOMICS:
THE GRANGER CAUSALITY TEST
• More generally, since the future cannot predict the past, if
variable X (Granger) causes variable Y, then changes in X
should precede changes in Y.
• Therefore, in a regression of Y on other variables (including its
own past values) if we include past or lagged values of X and it
significantly improves the prediction of Y, then we can say
that X (Granger) causes Y.
• A similar definition applies if Y (Granger) causes X.
• The steps involved in implementing the Granger causality test
are as follows.
• We illustrate these steps with the GDP-money example given
in Eq. (8.5.1)
RIZAUDIN SAHLAN 89
8.5 CAUSALITY IN ECONOMICS:
THE GRANGER CAUSALITY TEST
1. Regress current GDP on all lagged GDP terms and other
variables, if any, but do not include the lagged M variables in
this regression (restricted regression). Obtain the restricted
residual sum of squares, 𝑅𝑆𝑆𝑅 .
2. Run the regression including the lagged M terms
(unrestricted regression). Obtain the unrestricted residual
sum of squares, 𝑅𝑆𝑆𝑈𝑅 .
3. The null hypothesis is 𝐻0 : 𝛼𝑖 ≠ 0 , that is, lagged M terms
do not belongin the regression.
RIZAUDIN SAHLAN 90
8.5 CAUSALITY IN ECONOMICS:
THE GRANGER CAUSALITY TEST
4. To test this hypothesis, we apply the F test;
(8.5.3)
follows the F distribution with m and (n− k) df. and m is
equal to the number of lagged M terms and k is the
number of parameters estimated in the unrestricted
regression.
5. If the computed F value exceeds the critical F value at the
chosen level of significance, we reject the null hypothesis, in
which case the lagged M terms belong in the regression. This
is another way of saying that M causes GDP.
6. Steps 1 to 5 can be repeated to test the model (8.5.2), that
is,whether GDP causes M. RIZAUDIN SAHLAN 91
8.5 CAUSALITY IN ECONOMICS:
THE GRANGER CAUSALITY TEST
• Before we illustrate the Granger causality test, there are
several things that need to be noted:
1. It is assumed that the two variables, GDP and M, are
stationary.
2. The number of lagged terms to be introduced in the causality
tests is an important practical question. Use the Akaike or
Schwarz information criterion to make the choice.
3. We have assumed that the error terms entering the causality
test are uncorrelated.
4. Since our interest is in testing for causality, one need not
present the estimated coefficients of models (8.5.1) and
(8.5.2) explicitly (to save space); just the results of the F test
given in (8.5.3) will suffice.
RIZAUDIN SAHLAN 92
8.5 CAUSALITY IN ECONOMICS:
THE GRANGER CAUSALITY TEST
Example : Causality test between industrial production and
stock prices
• We use the data in volat.dta.
• Let 𝑝𝑐𝑖𝑝 be the percentage change in industrial production
(yearly) and lets 𝑝𝑐𝑠𝑝 be the percentage change in stock
market (yearly).
𝑛 𝑛
𝑝𝑐𝑖𝑝𝑡 = 𝑖=1 𝛼𝑖 𝑝𝑐𝑠𝑝𝑡−𝑖 + 𝑗=1 𝛽𝑖 𝑝𝑐𝑖𝑝𝑡−𝑖 + 𝑢1𝑡 (8.5.4)
𝑛 𝑛
𝑝𝑐𝑠𝑝𝑡 = 𝑖=1 𝜆𝑖 𝑝𝑐𝑠𝑝𝑡−𝑖 + 𝑗=1 𝛿𝑖 𝑝𝑐𝑖𝑝𝑡−𝑖 + 𝑢2𝑡 (8.5.5)
RIZAUDIN SAHLAN 93
8.5 CAUSALITY IN ECONOMICS:
THE GRANGER CAUSALITY TEST
200
100
0
-100
-200
pct chg, IP, ann rate pct chg, sp500, ann rate
RIZAUDIN SAHLAN 94
8.5 CAUSALITY IN ECONOMICS:
THE GRANGER CAUSALITY TEST
• To perform the Granger causality test, we must make sure all
data must be stationary at same level.
• Lets we perform the ADF test for 𝑝𝑐𝑖𝑝 and 𝑝𝑐𝑠𝑝 variables.
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
RIZAUDIN SAHLAN 95
8.5 CAUSALITY IN ECONOMICS:
THE GRANGER CAUSALITY TEST
• ADF test for 𝑝𝑐𝑠𝑝 in level form;
. dfuller pcsp
Interpolated Dickey-Fuller
Test 1% Critical 5% Critical 10% Critical
Statistic Value Value Value
• The ADF test for 𝑝𝑐𝑖𝑝 and 𝑝𝑐𝑠𝑝 is already stationary at level
form, or 𝑝𝑐𝑖𝑝~𝐼 0 and 𝑝𝑐𝑠𝑝~𝐼 0 .
RIZAUDIN SAHLAN 96
8.5 CAUSALITY IN ECONOMICS:
THE GRANGER CAUSALITY TEST
• The equations in (8.5.4) and (8.5.5) show that the variables in
right-hand side is distributed with the number of lags in 𝑛.
• We need to know the number of optimum lags will be
included in (8.5.4) and (8.5.5) by the information criterion.
• To do this, we will used the Stata command varsoc.
Selection-order criteria
Sample: 10 - 558 Number of obs = 549
RIZAUDIN SAHLAN 97
8.5 CAUSALITY IN ECONOMICS:
THE GRANGER CAUSALITY TEST
• The information criterion for AIC shows that the optimum lags
is 4. So, this is number of lags we will include in our analysis
for (8.5.4) and (8.5.5).
• The, our model for Granger-causality test will become;
4 4
𝑝𝑐𝑖𝑝𝑡 = 𝑖=1 𝛼𝑖 𝑝𝑐𝑠𝑝𝑡−𝑖 + 𝑗=1 𝛽𝑖 𝑝𝑐𝑖𝑝𝑡−𝑖 + 𝑢1𝑡 (8.5.6)
4 4
𝑝𝑐𝑠𝑝𝑡 = 𝑖=1 𝜆𝑖 𝑝𝑐𝑠𝑝𝑡−𝑖 + 𝑗=1 𝛿𝑖 𝑝𝑐𝑖𝑝𝑡−𝑖 + 𝑢2𝑡 (8.5.7)
RIZAUDIN SAHLAN 98
8.5 CAUSALITY IN ECONOMICS:
THE GRANGER CAUSALITY TEST
• First, we test the direction for 𝑝𝑐𝑠𝑝 → 𝑝𝑐𝑖𝑝 in (8.5.6);
pcsp
L1. .0225342 .0130618 1.73 0.085 -.0031236 .048192
L2. .0369286 .0135071 2.73 0.006 .0103961 .0634611
L3. .0093613 .0135427 0.69 0.490 -.017241 .0359636
L4. .0417713 .013154 3.18 0.002 .0159325 .0676101
pcip
L1. .3166854 .0424916 7.45 0.000 .2332176 .4001532
L2. .054438 .0444751 1.22 0.221 -.0329259 .141802
L3. .0681262 .0443053 1.54 0.125 -.0189042 .1551566
L4. .0214643 .0420152 0.51 0.610 -.0610676 .1039962
RIZAUDIN SAHLAN 99
8.5 CAUSALITY IN ECONOMICS:
THE GRANGER CAUSALITY TEST
• We will used the formula in 8.5.3 to calculate the F-statistics
and then we will compared the F-statistics with the F-critical
with the level of significance we chosen.
• If F-statistics > F-critical, reject the 𝐻0 with means that 𝑝𝑐𝑠𝑝 is
Granger-cause to 𝑝𝑐𝑖𝑝.
• But, this things will easy when we using Stata with command
test
F( 4, 544) = 6.70
Prob > F = 0.0000
pcsp
L1. .2580261 .0428232 6.03 0.000 .173907 .3421453
L2. -.080877 .0442831 -1.83 0.068 -.1678638 .0061099
L3. .0228424 .0443996 0.51 0.607 -.0643733 .1100581
L4. .0552407 .0431252 1.28 0.201 -.0294717 .1399531
pcip
L1. -.072219 .1393088 -0.52 0.604 -.345868 .20143
L2. -.1342847 .1458115 -0.92 0.357 -.4207073 .1521379
L3. -.0853891 .1452548 -0.59 0.557 -.3707181 .1999399
L4. .0181298 .1377468 0.13 0.895 -.252451 .2887106
F( 4, 544) = 0.73
Prob > F = 0.5751
Vector autoregression
pcip
pcip
L1. .3166854 .0424916 7.45 0.000 .2332176 .4001532
L2. .054438 .0444751 1.22 0.221 -.0329259 .141802
L3. .0681262 .0443053 1.54 0.125 -.0189042 .1551566
L4. .0214643 .0420152 0.51 0.610 -.0610676 .1039962
pcsp
L1. .0225342 .0130618 1.73 0.085 -.0031236 .048192
L2. .0369286 .0135071 2.73 0.006 .0103961 .0634611
L3. .0093613 .0135427 0.69 0.490 -.017241 .0359636
L4. .0417713 .013154 3.18 0.002 .0159325 .0676101
pcsp
pcip
L1. -.072219 .1393088 -0.52 0.604 -.345868 .20143
L2. -.1342847 .1458115 -0.92 0.357 -.4207073 .1521379
L3. -.0853891 .1452548 -0.59 0.557 -.3707181 .1999399
L4. .0181298 .1377468 0.13 0.895 -.252451 .2887106
pcsp
L1. .2580261 .0428232 6.03 0.000 .173907 .3421453
L2. -.080877 .0442831 -1.83 0.068 -.1678638 .0061099
L3. .0228424 .0443996 0.51 0.607 -.0643733 .1100581
L4. .0552407 .0431252 1.28 0.201 -.0294717 .1399531