Time Series Chap21 (2)
Transcript of Time Series Chap21 (2)
-
8/4/2019 Time Series Chap21 (2)
1/27
Time Series Data Analysis
Main Reading: Gujarati, Chapter 21.
Hamid Ullah
-
8/4/2019 Time Series Chap21 (2)
2/27
Key Concepts
Stationarity and non-stationarity.
Autoregressive and moving average
processes.
Unit roots.
Dickey fuller test.
Cointegration and spurious regressions.
Testing for cointegration.
-
8/4/2019 Time Series Chap21 (2)
3/27
Univariate Time Series Models
Aim to describe the behaviour of a
variable in terms
of its past values
Why use these models?
SimpleLack of theoryUseful for forecasting
-
8/4/2019 Time Series Chap21 (2)
4/27
Autoregressive processes:
An AR(1) process is written as
yt = yt-1 + t
where t ~ IID(0,2)
ie. the current value of yt is equal to times its previous
value plus an unpredictable component t
This can be extended to an AR(p) process
yt = 1yt-1 + 2yt-2+..+pyt-p + t
where t ~ IID(0,2)
ie. the current value of yt depends on p past values plus
an unpredictable component t
-
8/4/2019 Time Series Chap21 (2)
5/27
Moving Average processes:
A MA(1) process is written as
yt = t + t-1
where t ~ IID(0,2)
ie. the current value is given by an unpredictable
component t and times the previous periods error
This can also be extended to an MA(q) process
yt = t + 1t-1 +..+ qt-q
where
t ~ IID(0,
2
)
-
8/4/2019 Time Series Chap21 (2)
6/27
STOCHASTIC PROCESSES
A random or stochastic process is acollection of random variables ordered in
time and is often denoted by Yt, where t =1,,T (where the subscript t representstime).
Time series data has a temporal ordering,unlike cross-section data.
-
8/4/2019 Time Series Chap21 (2)
7/27
What is Stationarity?
A stochastic process is said to be stationary if its
mean and variance are constant over time and the
value of the covariance between the two time
periods depends only on the distance or gap
between the two time periods and not the actual
time at which the covariance is computed
-
8/4/2019 Time Series Chap21 (2)
8/27
StationarityStationarity may be strong or weak (covariance)
E(yt) is independent of time;
Var(yt) is a finite, positive constant and independent
of time;
Cov(yt, yk) is a finite function of t-k, but not of t or k
The whole distribution of the
variable does not depend on time
-
8/4/2019 Time Series Chap21 (2)
9/27
Thus, this weaker form of Stationarity
requires only that the mean and variance are
constant across time, and the covariancebetween the two time periods depends only
on the distance or gap or lag between the
two time periods and not the actual time atwhich the covariance is computed.
if a time series is stationary, its mean,
variance, and auto-covariance (at variouslags) remain the same no matter at what
point of time we measure them; that is, they
are time invariant.
-
8/4/2019 Time Series Chap21 (2)
10/27
Non Stationarity
a non stationary time series will have a time-varying mean or a time-varying variance or both.
our interest is in stationary time series, one oftenencounters non-stationary time series, the classic
example being the random walk model (RWM).
stock prices or exchange rates, follow a random
walk; that is, they are non stationary.
-
8/4/2019 Time Series Chap21 (2)
11/27
11
Non-stationary TS
Non-stationary series can be due todeterministic trend
tt etY
ttteYY
1
or stochastic trend (has a unit root)
or both!
-
8/4/2019 Time Series Chap21 (2)
12/27
12
Random Walks
A random walk is an AR(1) model wherer1 = 1,
meaning the series is not weakly dependent.
With a random walk, the expected value ofyt is aconstant (it doesnt depend on t).
Var(yt) = e2t, so it increases with t.
We say a random walk is highly persistent sinceE(yt+h|yt) =ytfor all h 1
-
8/4/2019 Time Series Chap21 (2)
13/27
Types of random walks
There are two types of RWM
(1) Random walk without drift (i.e., no constant
or intercept term)
(2) random walk with drift (i.e., a constant term is
present.)
-
8/4/2019 Time Series Chap21 (2)
14/27
Random Walk without Drift.
The value of Y at time t is equal to its value attime (t 1) plus a random shock; thus it is
an AR(1) model.
Yt = Yt1 + ut Efficient capital market hypothesis argue that stock prices
are essentially random and therefore there is no scope for
profitable speculation in the stock market: If one could
predict tomorrows price on the basis oftodays price, wewould all be millionaires.
-
8/4/2019 Time Series Chap21 (2)
15/27
Y1 = Y0 + u1
Y2 = Y1 + u2 = Y0 + u1 + u2
Y3 = Y2 + u3 = Y0 + u1 + u2 + u3
In general, if the process started at some time 0 with a
value of Y0, we have
Yt = Y0 + ut
the mean of Y is equal to its initial, or starting, value,which is constant, but as t increases, its variance increases
Indefinitely, thus violating a condition of stationarity.
In short, the RWM without drift is a non stationary
stochastic process. (Yt Yt1) = Yt = ut
its first difference is stationary. In other words, the first
differences of a random walk time series are stationary. So
it is Difference Stationarity Process (DPS)
-
8/4/2019 Time Series Chap21 (2)
16/27
Random Walk with Drift.Yt = + Yt1 + ut
where is known as the drift parameter. The name drift comes
from the fact that if we write the preceding equation as
it shows that Yt drifts upward or downward, depending on
being positive or negative. Note that above model is also anAR(1) model. var (Yt ) = t2
RWM with drift the mean as well as the variance increases over
time, again violating the conditions of (weak) Stationarity.
The above model is a DSP process because the non Stationarity in
Yt can be eliminated by taking first differences of the time series.
-
8/4/2019 Time Series Chap21 (2)
17/27
17
Trending Series The general tendency of the time series data to increase or
decrease during a long period of time is called the seculartrend or long term trend or simply trend.
The concept of trend does not include short range
oscillations.
Trend may have either upward or downward movement,such as production, prices, income are upward trend while a
downward trend is noticed in the time series relating to
deaths, epidemics etc.
A trending series cannot be stationary, since the mean ischanging over time.
If a series is weakly dependent and is stationary about its
trend, we will call it a trend-stationary process.
-
8/4/2019 Time Series Chap21 (2)
18/27
18
Types of TrendsLinear or Straight Line Trend:
If we get a straight line, when the values are plotted on a graph,then it is called a linear trend.
yt = 0 + 1t + et, t = 1,2,
Non-Linear Trend:
If we get a curve after plotting the time series values then it is
called non-linear or curvilinear trend.
a. Another possibility is an exponential trend, which can be
modeled as
log(yt) = 0 + 1t + et, t = 1,2,
b. Another possibility is a quadratic trend, which can be modeled
as
yt = 0 + 1t + + 2t2 + et, t = 1,2,
-
8/4/2019 Time Series Chap21 (2)
19/27
19
Unit Root
We can write the AR(1) model as follows:
More precisely, if is 1 [a random walk], we facewhat is known as a unit root problem. In fact, this isexactly the random walk (without drift) described
above. Note, the variance is not stationary.
-
8/4/2019 Time Series Chap21 (2)
20/27
20
Non-stationary to stationary
Add a trend (i.e. make it trend stationary)
Difference the series (i.e. make it stochastic
difference stationary) Stationary series are I(0) i.e. integrated of order 0.
For I(1) series, difference once to make stationary; For I(2)
series, difference twice to make stationary, etc.
Or, add a trend as well as difference of the series
-
8/4/2019 Time Series Chap21 (2)
21/27
21
Graphical test for Stationarity
One simple test of stationarity is based on the so-
called autocorrelation function (ACF). The ACF at
lag k, denoted by k, is defined as
This can be estimated by the sample ACF
-
8/4/2019 Time Series Chap21 (2)
22/27
22
In other words, the autocorrelation function k
is the correlation between a variable (say, Y)and Y lagged kperiods.
-
8/4/2019 Time Series Chap21 (2)
23/27
23
Testing for Unit Roots
Consider an AR(1): yt= +ryt-1 + et
Let H0:r= 1, (assume there is a unit root).
Define =r1 and subtractyt-1 from both sidesto obtain Dyt= + yt-1 + et.
Unfortunately, a simple t-test is inappropriate,
since this is an I(1) process.
A Dickey-Fuller Test uses the t-statistic, but
different critical values.
-
8/4/2019 Time Series Chap21 (2)
24/27
24
Testing for Unit Roots (cont.d.)
We can addp lags ofDytto allow for more dynamics
in the process.
Still want to calculate the t-statistic for .
Now its called an augmented Dickey-Fuller test, but
still the same critical values.
The lags are intended to clear up any serial
correlation, if too few, test wont be right.
-
8/4/2019 Time Series Chap21 (2)
25/27
25
Testing for Unit Roots w/ Trends
If a series is clearly trending, then we need to adjust
for that or might mistake a trend stationary series for
one with a unit root. Can just add a trend to the model.
Still looking at the t-statistic for q, but the critical
values for the Dickey-Fuller test change.
-
8/4/2019 Time Series Chap21 (2)
26/27
26
The Augmented DickeyFuller
(ADF) Test The ADF test consist of estimating the following
equation
If1 = 0 then no deterministic trend
If = 0 then the series has stochastic trend
For example, = ( -1) for AR(1) model (where ifyou recall, unit root means =1).
-
8/4/2019 Time Series Chap21 (2)
27/27
27
AR(p) model
And its generalization with p-lags can be writtenas:
tptptt eYYtY 31321 ...
tmtmttteYYYtY DDD
...
11121
which can be written as:
The deterministic trend with stationary AR(1)
component can be written as:
ttt eYtY 1321