<<

DIKTAT METODE PENELITIAN ( Ekonometrika - Quantitative Method )

Oleh : Kumba Digdowiseiso

FAKULTAS EKONOMI UNIVERSITAS NASIONAL Quantitative Method Analysis: Time Series (1)

Kumba Digdowiseiso

Quantitative Method Analysis: Time Series (2)

Kumba Digdowiseiso Stationarity

• OLS estimates for time series models will only be BLUE if, in addition to the usual OLS assumptions, the time series are stationary. • A stochastic time-series is said to be weakly stationary if its and are constant over time and the value of the between the two time periods depends only on the lag between the two time periods.

• i.e. if Yt is a stochastic time series, it is weakly stationary if it has the following statistical properties:

Mean: E(Yt )= µ Variance: 2 2 var(Yt )= E(Y t − µ) =σ

Covariance: γ k = E[(Yt − µ)(Yt+k − µ)]

Where γk , the covariance between 2 variables k time periods apart, only depends on k and not t. • A stationary time series exhibits mean reversion • Do economic time series usually exhibit these properties? Recall the examples of time series that were discussed in the last session

250

200 index

150 price

100

50 IMF commodity commodity IMF

0

Data source: IMF IFS 2011 Monthly interest rates in South Africa

14

12

10

8 % 6

4

2

0

Money market interest rate Government bond yield

Data source: IMF IFS 2011 Consumer and producer price indices and broad money suuply in South Africa

160 3,E+06

140 2,E+06 120

100 2,E+06

80 (millions)

60 1,E+06

40 SA Rand 5,E+05 20

0 0,E+00

PPI CPI Broad money supply (right axis)

Data source: IMF IFS 2011 ut ~ NIID(0,σ ) Gaussian White 2 4 2 1 2 0 wn1 wn3 0 -1 -2 -2 -3

0 20 40 60 80 100 0 20 40 60 80 100 time time White Noise Process – A stochastic stationary time series

• The white noise process can be seen as the basic building block for more complex stochastic DGPs (more next session) – The residuals from all time series regressions should be white noise

• This is a purely random since it has zero mean. • A white noise can be described as a series of random shocks where the succesive observations are uncorrelated with each other. • Typical feature: the series jumps up and down in an unsystematic way.

• The value of ut cannot be predicted from ut-1 u ~ NIID(0,σ ) t 2 : an example of a non-stationary stochastic process • Economic time series tend not to be stationary • The Random Walk model is a classic example of a non-stationary DGP • Pure Random Walk: = + where u is a white noise error term 푌푡 푌푡−1t 푢푡 = 푡 푡 =1 푡 푌 푡 푢 15 5 10 0 5 rw3 rw1 -5 0 -10 -5

0 20 40 60 80 100 0 20 40 60 80 100 time time Random walk with drift 80 60

• = + + 40 where푌푡 훿is the푌푡−1 drift 푢term푡 and ut is a white noise error term 20 훿

• The drift term represents a 0 0 20 40 60 80 100 stochastic trend time

• Stock prices, exchange rates and other assets are said to follow a random walk • In fact, testing whether an asset price follows a random walk is a way if testing the efficient market hypothesis empirically – Why is that? Properties of the Random Walk

• Let Yt be generated by a random walk process with no drift:

Yt = Yt −1 +ut

where ut is generated by a white noiseprocess

• Note that the RW model can be rewritten such that Yt is expressed as a sum of the past values of the error term, i.e. The sum of a series of random shocks that persist over time.

Yt = Y0 + ∑ut

where Y0 is the value of Y at t = 0, the start of the process. • Taking expected values we get:

E(Yt )= E(Y0 + ∑ut )= Y0

2 • It can be shown that: var(Yt )= tσ where σ2 is the variance of the error term • While the random walk model is nonstationary, it’s first difference is.

(Yt −Yt−1 )= ∆Yt = ut Properties of the Random Walk with Drift

• Let Yt now be generated by a random walk process with a drift:

Yt = δ +Yt−1 + ut

where ut is generated by a white noise process

• δ is the drift parameter. Yt drifts upwards or downwards depending on the sign on δ. • It can be shown for the random walk with drift that:

E(Yt )= Y0 + t.δ var(Y )= tσ 2 where σ2 is the variance of the error term • Taking the first difference of the model gives:

Yt −Yt−1 = ∆Yt = δ + ut • If δ > 0, Y will drift upwards and if δ < 0 Y will exhibit a downward drift Difference stationary stochastic processes

• The pure random walk is known as a difference since the first difference of the model is stationary. i.e. It’s mean and variance are time invariant and the covariance depends only in the length of the lag between observations. • Consider the first difference for the random walk with drift:

Yt −Yt −1 = ∆Yt = δ + ut

where ut is generated by a white noise process

• Yt will exhibit a positive or negative trend depending on the sign on δ.

• Since we cannot predict the value of the error term or Yt on the basis of past values we say that the random walk with drift model has a stochastic trend.

• ΔYt is a difference stationary process, why? Trend Stationary Stochastic Processes

• A time series might exhibit a deterministic trend, that is its value is partially determined by the evolution of time.

• Consider the following model where Yt:

Yt = β1 + β2t +ut

• The mean of Yt,, β1+ β2t, is not constant, but it’s variance, σt is.

• Subtracting the mean from Yt removes the deterministic trend and gives a stationary process.

• Here, Yt is known as a trend stationary process since the procedure of detrending results in a stationary process. Graphical comparison of time series with a stochastic trend and a deterministic trend 300 200 100 0

0 100 200 300 400 500 time

stochastic deterministic Orders of integration If: It is said to Notation be integrated of order… a time series, Yt, is stationary 0 Yt ~ I(0) e.g the white noise process the first difference of a series, Yt, 1 Yt ~ I(1) is stationary e.g. the random walk without drift a time series has to be 2 Yt ~ I(2) differenced twice to make it stationary (i.e the first difference of the first difference of Yt is stationary),

Yt has to be differenced d times D Yt ~ I(d) before it becomes stationary, Some Properties of integrated series

If then

1 Xt ~I(0) and Yt~I(1) Z(t) = (Xt+Yt)~I(1)

2 Xt~I(d) Z(t) = (a+bXt)~I(d), where a and b are constants

3 Xt ~I(d1) and Yt~I(d2) Z(t) = (aXt+bYt)~I(d2), where d1< d2

* 4 Xt~I(d) and Yt~I(d) Z(t) = (aXt+bYt)~I(d ) * d =d unless Xt and Yt are cointegrated in which case d*

• To illustrate why it is important to know the order of integration of series consider:

Yt = β1 + β2 Xt +ut x y βˆ = ∑ t t 2 2 where xt = Xt − X and yt = Yt −Y ∑ xt

• +

• Suppose that Yt is I(0), but Xt isI(1).

• Since Xt is not stationary, it’s variance will increase overtime in the expression for the OLS estimators with the result that the estimator for β2 will converge to zero as the time span increases. Spurious regression

• A second reason why it is important to establish that series are I(0), i.e. stationary, before we estimate on the basis of OLS is the problem of spurious regression.

• Spurious, or nonsense, regression refers to the phenomenon where we might concluded that a relationship between two or more variables nonstationary is highly significant when there is no relationship between them at all. Tests for stationarity – Function (ACF) and

• We have already come across the first order autocorrelation function in lecture 6. the ACF at lag K is defined as: ( ) γ cov Yt,Y t+k k − ≤ ρ ≤ ρk = = , 1 k 1 var(Yt ) γ 0

• ρk gives the population autocorrelation function. In practice we can only calculate the sample ACF. γˆ = k ρˆ k γˆ0 2 (Y− Y ) ∑(Yt −Y )(Y t+k −Y ) ∑ t where γˆ = and γˆ0 = k n n • The plot of the sample ACF is known as the sample correlogram Correlogram for a white noise 0.20 0.00 -0.20

0 10 20 30 40 Lag Bartlett's formula for MA(q) 95% confidence bands Correlogram for a random walk 1.00 0.50 0.00 -0.50

0 10 20 30 40 Lag Bartlett's formula for MA(q) 95% confidence bands Unit root tests

• Stationarity can also sometimes be expressed as the absence of a unit root in a time series. • Consider the random walk model:

Yt = ρYt −1 + ut −1 ≤ ρ ≤1 (d1)

where ut is a white noise • If ρ is 1, then the model contains a unit root and the series is I(1), the series Yt is not stationary.

• If |ρ|≤1, then it can be shown that the time series Yt is stationary in the sense that we have defined it.

• Unit root tests are therefore based on discovering whether or not the DGP underlying the time-series contains a unit root. The Dickey-Fuller (DF) test for the presence of a unit root

• Subtracting Yt-1 from both sides of (d1) gives:

Yt −Yt−1 = ρYt−1 −Yt−1 + ut

= (ρ −1)Yt−1 + ut

∆Yt = δYt −1 + ut

• The null hypothesis is that there is a unit root, i.e H0: δ=0, (ρ=1)

• The DF test statistic is calculated in the same way as the usual t-value.

• Under the null hypothests, the t-value of the estimated coefficient on Yt-1 follows the Dickey Fuller distribution and not the student t-distribution.

• Is the usual t-test valid if we reject H0 : δ=0? DF and ADF test procedure

• For guidance on the test procedure when working in STATA can be found in the handout

• You will have a chance to go through the procedure in the computer workshop for cointegration and error correction models Correlogram for a white noise 0.20 0.00 -0.20

0 10 20 30 40 Lag Bartlett's formula for MA(q) 95% confidence bands Correlogram for a random walk 1.00 0.50 0.00 -0.50

0 10 20 30 40 Lag Bartlett's formula for MA(q) 95% confidence bands Unit root tests

• Stationarity can also sometimes be expressed as the absence of a unit root in a time series. • Consider the random walk model:

Yt = ρYt −1 + ut −1 ≤ ρ ≤1 (d1)

where ut is a white noise • If ρ is 1, then the model contains a unit root and the series is I(1), the series Yt is not stationary.

• If |ρ|≤1, then it can be shown that the time series Yt is stationary in the sense that we have defined it.

• Unit root tests are therefore based on discovering whether or not the DGP underlying the time-series contains a unit root. The Dickey-Fuller (DF) test for the presence of a unit root

• The DF test is estimated with three specifications and three different null hypotheses • The test statistic in each case follows a different distribution for each of the three specifications of the DF test

1 Yt is a random walk H0: δ=0, ρ=1the series is ∆Y = δY − +u t t 1 t nonstationary

H1: δ<0 the series is stationary with zero mean

2 Yt is a random walk ∆Yt = β1 + δYt −1 +ut H0: δ=0, ρ=1

with drift H1: δ<0 the series is stationary with a nonzero mean[=β1/(1- ρ)]

3 Yt is a random walk H0: δ=0, ρ=1 ∆Yt = β1 + β2t +δYt−1 + ut with drift and a H1: δ<0 the series is stationary deterministic trend around a deterministic trend The Augmented Dickey-Fuller (ADF) test

• The DF test is based on the assumption that there is no autocorrelation in the error term ut.

• The ADF can be used to test for a unit root when the error terms ut in the three DF-specifications are autocorrelated. • The three DF- specifications are augmented by adding the lagged values of the dependent variable ΔYt. • For the case of a random walk with drift and a deterministic trend we would run the following regression:

m ∆Yt = β1 + β2t + δYt−1 +αi ∑ ∆Yt−i + εt i=1

where εt is a pure white noise error term and where

∆Yt−1 = (Yt−1 −Yt−2 ), ∆Yt−2 = (Yt−2 −Yt−3 ),etc • H0: δ=0 and the test statistic follows the same distribution as the DF statistic. Unit root tests – a word of caution

• The DF and ADF tests are two of many unit root tests including the Phillips-Perron. • Different unit root tests differ in terms of the size and the power of the test. • The size of the test refers to the probability of committing type I error. The DF test is sensitive to which specification is used. – Using the wrong one of the three models can increase the probability of committing a type I error. • The power of the test refers to the probability of committing type II error. Most tests of the DF type have low power. There may be problems if: i) the time span is short; ii) ρ is close to but not exactly 1; iii) there is more than a single unit root (i.e the series is I(2), I(3), etc.); iv) there are structural breaks in the series.