TS Chap 2
TS Chap 2
Samuel name/s
using here
Carter etal.
Chapter Two:
Introduction to basic regression
Chapter
analysis heading
with time series data
Time series Data Analysis: Objectives of the chapter
1
Time series Data Analysis: Nature of TS data
1. Temporal ordering
• A TS data set is provided in order of time (chronological)
For example: 2020 immediately precede the data for 2021 and
so forth.
• The past can affect the future but not the future.
2. Stochastic process
A stochastic process is just a sequence of random variables
indexed by time.
In TS stochastic is a “synonym for random”
when we collect a TS data set, we obtain one possible
outcome, or realization of the stochastic process.
1
Time series Data Analysis: Nature of TS data
1
Time series Data Analysis: Nature of TS data
MON T H T H H T T T .
TUS H T T T T H T H .
WED T H H T T H T H .
THR H T T T T H T T .
FRI T T T H H T H T .
SAT H H H H H T H T .
SUN T H H T H H T T .
MON T H T H H T T T .
A
TUS H T T T T H T H .
WED T H H T T H T H .
THR H T T T T H T T .
FRI T T T H H T H T .
SAT H H H H H T H T .
SUN T H H T H H T T .
The following two natures are not true for all time TS data
3. Trend time series
• Many economic variables have a tendency of growing up
overtime.
• Considering existence of time trend in TS is important while
making a casual inference among a TS data,
• if not we will face a problem of Spurious regression
The trend in a TS can be:
o Deterministic
Or
o Stochastic
1
Time series Data Analysis: Nature of TS data
4. Seasonality
• Often TS data exhibits some periodicity.
Example: in monthly data retail sales will tend to jump in
months of holidays.
• Seasonality can be dealt with adding a set of seasonal
dummies in our regression model.
1
Time series Data Analysis: Some examples of TS Models
1. Static model
• If y and 𝑧 are a TS variables and the data are dated
contemporaneously, we have
𝑦𝑡 = 𝛼0 + 𝛼1 𝑧𝑡 + 𝑢𝑡
• We call it a static model because we are modeling a
contemporaneous relationship between the two.
• We use it when we believe that the change in our explanatory
variable has an immediate effect on our dependent variable.
∆𝑦𝑡 = 𝛼1 ∆𝑧𝑡
• Naturally, we can have several explanatory variables in a static
regression model.
1
Time series Data Analysis: Some examples of TS Models
1
Time series Data Analysis: Some examples of TS Models
1
Time series Data Analysis: Some examples of TS Models
1
Time series Data Analysis: Some examples of TS Models
1
Time series Data Analysis: Some examples of TS Models
• Similarly
𝑦𝑡+1 − 𝑦𝑡−1 = 𝛿1
Is change in 𝑌 one period after the temporary change, and
𝑦𝑡+2 − 𝑦𝑡−1 = 𝛿2
Is change in 𝑦 two periods after the temporary change.
At time 𝑡 + 3, y has reverted back to its initial level: 𝑦𝑡+3 = 𝑦𝑡−1
because only two lags of 𝑧 appears in the FDL model.
In summary,
𝜕𝑦𝑡+𝑗
𝛿𝑗 =
𝜕𝑧𝑡
Lag distribution: 𝛿𝑗 is a function of 𝑗, which summarizes the dynamic
effects that a temporary increase in 𝑧 has on y
1
Time series Data Analysis: Some examples of TS Models
• When can also graph the lag distribution, to summarize the dynamic effect
that a temporary increase in 𝑧 has on y.
the largest effect is at the first lag. After that, the effect starts to vanishes (if
the initial shock was transitory).
1
Time series Data Analysis: Some examples of TS Models
𝜕𝑌𝑡+𝑞 𝜕𝑌𝑡+𝑞
𝐿𝑅𝑃 = 𝛿0 + 𝛿1 + 𝛿2 + ⋯ + 𝛿𝑞 = +⋯+
𝜕𝑧𝑡 𝜕𝑧𝑡+𝑞
1
Time series Data Analysis: Some examples of TS Models
1
Time series Data Analysis: Some examples of TS Models
1
Time series Data Analysis: Some examples of TS Models
1
Time series Data Analysis: Some examples of TS Models
1
Time series Data Analysis: Stationary and Non-stationary TS
Which data series represents stationary variables and which are observations
on non stationary variables?
1
Time series Data Analysis: Stationary stochastic process
1
Time series Data Analysis: Stationary stochastic process
1
Time series Data Analysis: Stationary stochastic process
1
Time series Data Analysis: Stationary stochastic process
Our AR(1) is :
𝑦𝑡 = 𝜌𝑦𝑡−1 + 𝑣𝑡 , 𝜌 <1
Where the error term is a white noise (purely random)
𝑣𝑡 ~𝐼𝐼𝐷 𝑂, 𝜎 2 ; 𝐸 𝑣𝑡 = 𝜎 2 ; 𝐶𝑜𝑣 𝑣𝑡 , 𝑣𝑡−1 = 0
Note: in the context of TS models the error terms are known as shocks or
Innovations.
o The assumption 𝜌 < 1 implies that 𝑦𝑡 is stationary.
o In general, the model implies each realization of random variable 𝑦𝑡
contains the portion 𝜌 of last period value 𝑦𝑡−1 plus an error 𝑣𝑡 drown
from the a distribution with mean zero and variance 𝜎 2 .
o To show 𝑦𝑡 is stationary let follow a recursive substitution
1
Time series Data Analysis: Stationary stochastic process
1
Time series Data Analysis: Stationary stochastic process
𝑡−1 𝑡−1
𝑡−1 2
𝜎
𝑣𝑎𝑟(𝑦𝑡 ) = 𝜌 𝑠 2 𝐸(𝑣𝑡−𝑠 )2 =
1 − 𝜌2
𝑠=0
1
Time series Data Analysis: Stationary stochastic process
𝜌𝜎 2
𝛾𝑠 = , 𝑖𝑡 𝑑𝑒𝑝𝑒𝑛𝑑𝑠 𝑜𝑛 𝑠
1 − 𝜌2
o 𝐴𝑅(1) is a classic example of stationary process with mean zero and
covariance which depends on the length of time difference between the
two values.
o A real world data seldom has zero mean value, to solve this problem
oWe can introduce a none zero mean 𝜇 and this process is known as
demeaning.
o To do so, we first replace 𝑦𝑡 with 𝑦𝑡 − 𝜇
1
Time series Data Analysis: Stationary stochastic process
𝑦𝑡 − 𝜇 = 𝜌 𝑦𝑡−1 − 𝜇 + 𝑣𝑡
𝑦𝑡 = 𝜌𝑦𝑡−1 + 𝜇 − 𝜌𝜇 + 𝑣𝑡
If 𝛼 = 𝜇 1 − 𝜌 , → 𝜇 = 𝛼 1 − 𝜌which is the mean value of 𝑦𝑡
𝑦𝑡 = 𝛼 + 𝜌𝑦𝑡−1 + 𝑣𝑡
o we can accommodate a nonzero mean in 𝑦𝑡 by
either working with the “demeaned” variable 𝑦𝑡 − 𝜇 or
by introducing the intercept term in the autoregressive process 𝑦𝑡 .
o Corresponding to these two ways, we describe the “de-meaned”
variable (𝑦𝑡 − 𝜇 ) as being stationary around zero, or the variable 𝑦𝑡
as stationary around its mean value (𝜇 = 𝛼 1 − 𝜌)
1
Time series Data Analysis: Stationary stochastic process
1
Time series Data Analysis: Stationary stochastic process
1
Time series Data Analysis: Stochastic trend
1
Time series Data Analysis: Stochastic trend
𝑦𝑡 = 𝑦𝑡−1 + 𝑣𝑡 = 𝑦0 + 𝑣𝑠
𝑠=1
Thus
𝐸(𝑦𝑡 ) = 𝑦0
𝑉𝑎𝑟(𝑦𝑡 ) = 𝑣𝑎𝑟 𝑣1 + 𝑣2 +. . +𝑣𝑡 = 𝐭𝝈𝟐
o A random walk has a mean equal to its initial value and variance that
increases overtime, eventually becoming infinity.
1
Time series Data Analysis: Stochastic trend
1
Time series Data Analysis: Stationary and Non-stationary TS
o Notice how the TS data appear to be “wandering” as well as “trending” upward (e).
o In general, random walk with drift models show definite trends either upward
(when the drift 𝛼 is positive) or downward (when the drift 𝛼 is negative).
1
Time series Data Analysis: Stochastic trend
𝑦2 = 𝛼 + 𝑦1 + 𝑣2 = 𝛼 + 𝑦0 + 𝑣1 + 𝑣2 = 2𝛼 + 𝑦0 + 𝑣𝑠
𝑠=1
………………………..
𝑡
𝑦𝑡 = 𝛼 + 𝑦𝑡−1 + 𝑣𝑡 = 𝑡𝛼 + 𝑦0 + 𝑣𝑠
𝑠=1
o The value of 𝑦 at time 𝑡 is made up of an initial value, the stochastic
trend component and a deterministic trend component 𝑡𝛼.
The variable 𝑦 wanders up and 𝐸 𝑦𝑡 = 𝑡𝛼 + 𝑦0
down as well as increases by a
fixed amount at each time 𝑡. 𝑣𝑎𝑟 𝑦𝑡 = 𝐭𝝈𝟐
1
Time series Data Analysis: Stochastic trend
𝑦2 = 𝛼 + 2𝜆 + 𝑦1 + 𝑣2 = 𝛼 + 2𝜆 + 𝑦0 + 𝑣1 + 𝑣2 = 2𝛼 + 3𝜆 + 𝑦0 + 𝑣𝑠
The additional
term has the
𝑠=1
effect of
……………………….. strengthening
𝑡 the trend
behavior
𝑦𝑡 = 𝛼 + 𝑡𝜆 + 𝑦𝑡−1 + 𝑣𝑡 = 𝑡𝛼 + [𝑡 𝑡 + 1 2]𝜆 + 𝑦0 + 𝑣𝑠
𝑠=1
o Where we have used the formula for a sum of an arithmetic progression,
1 + 2 + 3 + ⋯ + 𝑡 = [𝑡 𝑡 + 1 2]
1
Time series Data Analysis: Consequences of Stochastic Trends
1
Time series Data Analysis: Consequences of Stochastic Trends
o As you can see, the coefficient of 𝑥 is highly statistically significant, and, although
the 𝑅2 value is low, it is statistically significantly different from zero.
o You may be tempted to conclude that there is a significant statistical
relationship between 𝑦 and 𝑥
1
Time series Data Analysis: Consequences of Stochastic Trends
1
Time series Data Analysis: Unit Root Test
1
Time series Data Analysis: Unit Root Test
1
Time series Data Analysis: DF Test (No constant, No trend)
o Such kinds of tests are known as unit root test for stationarity.
o To make it formal consider
𝑦𝑡 = 𝜌𝑦𝑡−1 + 𝑣𝑡
1
Time series Data Analysis: DF Test (No constant, No trend)
1
Time series Data Analysis: DF Test (No constant, No trend)
1
Time series Data Analysis: DF Test (with constant, No trend)
1
Time series Data Analysis: DF Test (with constant, No trend)
1
Time series Data Analysis: DF Test (with constant and trend)
o For a series that have a clear time trend, we need to modify test for
unit root.
o If we carry out a DF test on a trending but stationary series, we will
probability have a little power rejecting a unit root.
o Hence, it is necessary to control for time while making this test, not
to mistaken trend stationary process to difference stationary process.
o If 𝑦𝑡 is stationary around a linear trend and described by the process
𝑦𝑡 = 𝛼 + 𝜌𝑦𝑡−1 + 𝜆𝑡 + 𝑣𝑡 𝜌 <1
o If 𝑦𝑡 is random walk with drift, then it is described as
𝑦𝑡 = 𝛼 + 𝑦𝑡−1 + 𝑣𝑡
1
Time series Data Analysis: DF Test (with constant and trend)
1
Time series Data Analysis: DF Test (with constant and trend)
1
Time series Data Analysis: DF Testing procedure
1
Time series Data Analysis: DF Testing procedure
• Why 𝜏 − 𝑠𝑎𝑡𝑖𝑠𝑡𝑖𝑐 ?
• Unfortunately the 𝑡 − 𝑠𝑡𝑎𝑖𝑠𝑡𝑖𝑐𝑠 has no longer t-distribution (Asymptotic
SND even in large sample size] that we have used in may cases to test
a zero null for a regression coefficient. Why?
o Because when the 𝐻0 is true, 𝑦𝑡 is not stationary, the variance
increases as the sample size increases. And this increase will alter the
distribution of the usual 𝑡 − 𝑠𝑎𝑡𝑖𝑠𝑡𝑖𝑐𝑠.
o Recognizing this fact Dickey and Fuller developed an appropriate
critical values often called 𝜏 − 𝑠𝑎𝑡𝑖𝑠𝑡𝑖𝑐
oThe critical values in 𝜏 − 𝑠𝑎𝑡𝑖𝑠𝑡𝑖𝑐 depends on the type of equation we
are using.
1
Time series Data Analysis: Some examples of TS Models
• Recall that to carry out this one tail test of significance, we reject the null
hypothesis of stationarity if:
𝜏 ≤ 𝜏𝑐 𝑜𝑟 𝜏 > 𝜏𝑐
Don't reject if
𝜏 > 𝜏𝑐 𝑜𝑟 𝜏 < 𝜏𝑐
1
Time series Data Analysis: Some examples of TS Models
Example: to test for a unit root in three-month T-bill rate we estimated and
obtained the following result
𝑟3𝑡 = 0.625 − 0.091𝑟3𝑡−1
0.261 0.037
𝑛 = 123 𝑅2 = 0.048
A, can we carry out the usual t-test? B, what does the coefficient of 𝑟3𝑡−1
imply?
1
Time series Data Analysis: Some examples of TS Models
1
Time series Data Analysis: Some examples of TS Models
𝑝−1
1
Time series Data Analysis: Augmented DF Test
• While augmented Dickey–Fuller tests remain the most popular tests for
unit roots, the power of the tests is low in the sense that
• they often cannot distinguish between a highly persistent stationary
process (where 𝜌 is very close but not equal to 1) and a nonstationary
process (where 𝜌 = 1).
•The power of the test also diminishes as deterministic terms constant
and trend are included in the test equation.
• tests that have been developed with a view to improving the power of
the test: the Elliot, Rothenberg, and Stock (ERS), Phillips and Perron
(PP), Kwiatkowski, Phillips, Schmidt, and Shin (KPSS), and Ng and
Perron (NP) tests.
1
Time series Data Analysis: Augmented DF Test
• The ERS test proposes removing the constant/trend effects from the
data and performing the unit root test on the residuals.
• The distribution of the t-statistic is now devoid of deterministic terms
(i.e., the constant and/or trend).
• The PP test adopts a nonparametric approach that assumes a general
autoregressive moving-average structure and uses spectral methods to
estimate the standard error of the test correlation.
• Instead of specifying a null hypothesis of nonstationary, theKPSS test
specifies a null hypothesis that the series is stationary or trend
stationary. NP tests suggest various modifications of the PP and ERS
tests..
1
Time series Data Analysis: Some examples of TS Models
Steps in TS Analysis
1
Time series Data Analysis: REMOVING THE TREND
1
Time series Data Analysis: Trend Stationary Process
1
Time series Data Analysis: Trend Stationary Variables
1
Time series Data Analysis: Trend Stationary Variables
1
Time series Data Analysis: Trend Stationary Variables
1
Time series Data Analysis: Trend Stationary Variables
𝑦𝑡 = 𝜃𝑠 𝑦𝑡−𝑠 + 𝛽𝑠 𝑥𝑡−𝑟 + 𝑒𝑡
𝑠=1 𝑟=0
𝑝 𝑞
𝑦𝑡 = 𝛼1 + 𝛼2 𝑡 + 𝜃𝑠 𝑦𝑡−𝑠 + 𝛽𝑠 𝑥𝑡−𝑟 + 𝑒𝑡
𝑠=1 𝑟=0
1
Time series Data Analysis: Difference Stationary Process
1
Time series Data Analysis: Difference Stationary Process
1
Time series Data Analysis: Integrated Stochastic Process
1
Time series Data Analysis: properties of Integrated series
1
Time series Data Analysis: cointegration
1
Time series Data Analysis: cointegration
1
Time series Data Analysis: cointegration
1
Time series Data Analysis: cointegration
Formal definition:
o Time series 𝑦𝑡 and 𝑥𝑡 are said to be cointegrated of order 𝑑, 𝑏
where 𝑑 ≥ 𝑏 ≥ 0, written as if
o If both series are integrated of order 𝑑,
o There exists a liner combination of these variables, say 𝛾𝑦𝑡 + 𝛿𝑥𝑡 ,
which is integrated of order 𝑑 − 𝑏 the vector [𝛾, 𝛿] is called the
cointegrating vector.
o It is also possible to generalize it for n variables case. If you want,
try it!
1
Time series Data Analysis: cointegration
1
Time series Data Analysis: cointegration
1
Time series Data Analysis: cointegration
1
Time series Data Analysis: cointegration
1
Time series Data Analysis: Engle Granger augmented approach (EG-AD test)
1
Time series Data Analysis: Engle Granger augmented approach (EG-AD test)
1
Time series Data Analysis: Some examples of TS Models
𝐵𝑡 = 1.14 + 0.914𝐹𝑡
… … … … . (1)
𝑡 (6.548) (29.425)
1
Time series Data Analysis: Error Correction Model
1
Time series Data Analysis: Error Correction Model
1
Time series Data Analysis: Error Correction Model
1
Time series Data Analysis: Error Correction Model
o First, add the term, −𝑦𝑡−1 , to both sides of the equation, this equation
can be rewritten as:
𝑦𝑡 − 𝑦𝑡−1 = 𝛿 + (1 − 𝜃1 )𝑦𝑡−1 + 𝛿0 𝑥𝑡 + 𝛿1 𝑥𝑡−1 + 𝑣𝑡
o Second, add the term 𝛿0 𝑥𝑡−1 − 𝛿0 𝑥𝑡−1 to the RHS to obtain:
𝑦𝑡 − 𝑦𝑡−1 = 𝛿 + (1 − 𝜃1 )𝑦𝑡−1 + 𝛿0 (𝑥𝑡 − 𝑥𝑡−1 ) + (𝛿0 + 𝛿1 )𝑥𝑡−1 + 𝑣𝑡
o Knowing ∆𝑦𝑡 = 𝑦𝑡 − 𝑦𝑡−1 and ∆𝑥𝑡 = 𝑥𝑡 − 𝑥𝑡−1 we can have:
∆𝑦𝑡 = 𝛿 + (𝜃1 −1)𝑦𝑡−1 + 𝛿0 ∆𝑥𝑡 + (𝛿0 + 𝛿1 )𝑥𝑡−1 + 𝑣𝑡
o If we then manipulate the equation to look like:
𝛿 𝛿0 + 𝛿1
∆𝑦𝑡 = (𝜃1 −1) + 𝑦𝑡−1 + 𝑥 + 𝛿0 ∆𝑥𝑡 + 𝑣𝑡
(𝜃1 −1) (𝜃1 −1) 𝑡−1
1
Time series Data Analysis: Error Correction Model
1
Time series Data Analysis: Error Correction Model
B. The term (𝜃1 −1) shows the „„correction‟‟ of ∆𝑦𝑡 to the „„error.‟‟
More specifically,
o If the error in the previous period is positive so that:
𝑦𝑡−1 > (𝛽1 + 𝛽2 𝑥𝑡−1 ), then 𝑦𝑡 should fall and ∆𝑦𝑡 should be
negative.
o Conversely, if the error in the previous period is negative so that:
𝑦𝑡−1 < (𝛽1 + 𝛽2 𝑥𝑡−1 ), then 𝑦𝑡 should rise and ∆𝑦𝑡 should be
positive.
1
Time series Data Analysis: Error Correction Model
1
Time series Data Analysis: Some examples of TS Models
1
Time series Data Analysis: Some examples of TS Models
Note first that we need two lags (∆𝐹𝑡 ∆𝐹𝑡−1 ) to ensure that the residuals are
purged of all serial correlation effects.
Second, note that the estimate 𝜃1 = −0.142 + 1 = 0.858 is less than one,
as expected.
1
Time series Data Analysis: Some examples of TS Models
1
Time series Data Analysis: Error Correction Model
1
Time series Data Analysis: Some examples of TS Models
Steps in TS Analysis
1
END of slide