Week 7 notes
Week 7 notes
Introduction to Time-Series
Stationarity
Time-Series and Stationarity
Introduction to AR Processes
Autoregressive (AR) Processes
Stationarity of AR Processes
Stationarity of AR Processes
• 𝜑(𝐿)𝑦𝑡 = 𝜇 + 𝑢𝑡 ; where 𝜑 𝐿 = 1 − 𝜑1 𝐿 − 𝜑2 𝐿2 − ⋯ − 𝜑𝑝 𝐿𝑝
• 𝑦𝑡 = 𝜑 𝐿 −1 𝑢
𝑡 [Ignore the drift]
• As the lag length is increased, the function 𝜑 𝐿 −1 should converge to zero
• If we compute the roots of this characteristic equation
• 𝜑 𝐿 = 1 − 𝜑1 𝐿 − 𝜑2 𝐿2 − ⋯ − 𝜑𝑝 𝐿𝑝 = 0
Autocorrelation Coefficient
Autocorrelation Coefficient
2
𝜏𝑘
• Ljung–Box (LB) statistic 𝑄 ∗ = 𝑇(𝑇 + 𝑚
2) σ𝑘=1
𝑇−𝑘
Autocorrelation Coefficient:
Numerical Example
Autocorrelation Coefficient
• Let us come to the joint test. The null hypothesis is that all the first
five coefficients are jointly zero. That is, 𝐻0 : 𝜏1 = 0; 𝜏2 = 0; 𝜏3 =
0; 𝜏4 = 0, 𝑎𝑛𝑑 𝜏5 = 0. The relevant critical values are obtained
from 𝜒 2 distribution with five degrees of freedom. These are 11.1
at 5% level, 15.1 at 1% level.
• The test statistic for BP test is given below. 𝑄 = 𝑇 σ𝑚 𝜏
𝑘=1 𝑘
2
2
𝜏𝑘
• The LB statistics is computed as follows. 𝑇(𝑇 + 2) σ𝑚
𝑘=1 𝑇−𝑘
Autocorrelation Coefficient
• Let us come to the joint test. The null hypothesis is that all the first five
coefficients are jointly zero. That is, 𝐻0 : 𝜏1 = 0; 𝜏2 = 0; 𝜏3 = 0; 𝜏4 =
0, 𝑎𝑛𝑑 𝜏5 = 0. The relevant critical values are obtained from 𝜒 2 distribution
with five degrees of freedom. These are 11.1 at 5% level, 15.1 at 1% level.
• The test statistic for BP test is given below.
𝐵𝑃 = 100 ∗ (0.2072 + −0.013 2 + 0.0862 + 0.0052 + −0.022 2 ) = 5.09.
0.2072
• The LB statistics is computed as follows. 𝐿𝐵 = 100 ∗ 100 + 2 ∗ ቀ +
100−1
−0.013 2 0.0862 0.0052 −0.022 2
+ + + ቁ = 5.26
100−2 100−3 100−4 100−5
Autocorrelation Coefficient
• So, in both cases, the joint null hypothesis that all of the first five
autocorrelation coefficients are zero cannot be rejected. Note
that, in this instance, the individual test caused a rejection while
the joint test did not.
• Thus, the effect of the significant autocorrelation coefficient is
diluted in the joint test by the insignificant coefficients.
INDIAN INSTITUTE OF TECHNOLOGY KANPUR
• 𝐸(𝑦𝑡 ) = 𝜇
• Var(𝑦𝑡 ) = 𝛾0 = (1 + 𝜃12 + 𝜃22 + 𝜃32 + ⋯ + 𝜃𝑞2 ) 𝜎 2
• Var(𝑦𝑡 ) = 𝐸 𝑦𝑡 − 𝐸 𝑦𝑡 𝑦𝑡 − 𝐸 𝑦𝑡
𝛾0
• 𝜏0 = =1
𝛾0
𝛾1 𝜃1 +𝜃1 𝜃2 𝜎 2 𝜃1 +𝜃1 𝜃2
• 𝜏1 = = =
𝛾0 (1+𝜃12 +𝜃22 ) 𝜎 2 (1+𝜃12 +𝜃22 )
𝛾𝑠 𝜃2
• 𝜏2 = =
𝛾0 (1+𝜃12 +𝜃22 )
INDIAN INSTITUTE OF TECHNOLOGY KANPUR
• 𝜑(𝐿)𝑦𝑡 = 𝜇 + 𝜃 𝐿 𝑢𝑡
• Where 𝜃 𝐿 = 1 + 𝜃1 𝐿 + 𝜃2 𝐿2 + ⋯ + 𝜃𝑞 𝐿𝑞
• 𝜑 𝐿 = 1 − 𝜑1 𝐿 − 𝜑2 𝐿2 − ⋯ − 𝜑𝑝 𝐿𝑝
• Also, 𝐸 𝑢𝑡 = 0; 𝐸 𝑢𝑡2 = 𝜎 2 ; 𝐸 𝑢𝑡 𝑢𝑠 = 0; 𝑡 ≠ 𝑠
ACF and PACF Plots: ARMA Process
• Auto-correlation function
(ACF) plot and partial ACF
plot
• An ARMA process has
• A geometrically decaying acf
• A geometrically decaying pacf
• Forecast from ARMA(p,q) model at time ‘t’ for ‘s’ steps into the
future is given as
𝑝 𝑞
• 𝑓𝑡+𝑠 = Σ𝑖=1 𝑎𝑖 𝑓𝑡+𝑠−𝑖 + Σ𝑘=1 𝑏𝑘 𝑢𝑡+𝑠−𝑘
• Here, 𝑎𝑖 and 𝑏𝑘 are the autoregressive and moving average
coefficients
Forecasting MA(q)
• Since the MA(3) process has a memory of only three periods, any
forecast of four or more steps ahead converge to long-term
unconditional mean (i.e., the intercept term)
INDIAN INSTITUTE OF TECHNOLOGY KANPUR
• MSE=(0.3600+0.0025+0.0000+0.0256+0.0081)/5=0.08
• MAE=(0.6000+0.0500+0.0000+0.1600+0.0900)/5=0.16
• RMSE=SQRT(MSE)=sqrt(0.08)=0.28
INDIAN INSTITUTE OF TECHNOLOGY KANPUR
Types of Non-Stationarity
Types of Non-Stationarity
• Two types of non-stationarity
• In financial econometrics, two kinds of non-stationarity become important
1. Random walk model with drift: y t = + yt-1 + ut (1)
2. Deterministic trend process: yt = + t + ut (2)
• Here ut is a white noise iid process distributed as N (0, 𝜎 2 )
Recall: White Noise IID Process
Stochastic Non-Stationarity
Stochastic Non-Stationarity
Deterministic Non-Stationarity
Deterministic Non-Stationarity
• A white noise process visibly has no trending behavior, and it frequently crosses its
mean value of zero.
• The random walk (thick line) and random walk with drift (faint line) process exhibit
‘long swings’ away from their mean value, which they rarely cross.
• A comparison of the two lines in this graph reveals that the positive drift leads to a
series that is more likely to rise over time than to fall; obviously, the effect of the drift
on the series becomes greater and greater the further the two processes are
tracked.
• Finally, the deterministic trend process clearly does not have a constant mean and
exhibits completely random fluctuations about its upward trend. If the trend were
removed from the series, a plot similar to the white noise process would result.
INDIAN INSTITUTE OF TECHNOLOGY KANPUR
• The test statistic does not follow the usual t-distribution under the
null since the null is one of non-stationarity but rather follows a
non-standard distribution.
• Tau values are larger (negative) than regular t-stat. indicating
more evidence required against null.
INDIAN INSTITUTE OF TECHNOLOGY KANPUR
• Most of the time if two variables are I(1), then their combination (error
term!) would also be I(1)
• Similarly, if two or more variables with different orders are combined,
then the combination will have the integration order equal I(d) to the
largest order variable I(d)
• Consider a simple regression model: 𝑦1 = 𝛼0 + 𝛼1 ∗ 𝑥1 + 𝛼2 ∗ 𝑥2 + 𝑢𝑡
or alternatively
• 𝑦1 − 𝛼0 − 𝛼1 ∗ 𝑥1 − 𝛼2 ∗ 𝑥2 = 𝑢𝑡 : here the error term is a combination
of three variables y1, x1, and x2.
Cointegration
• If these variables are I(1), chances are that error term would also be I(1).
• It would be desirable to have an error term as I(0): This is called cointegration.
• But what would be these economic and financial scenarios where an error would be
I(0).
• A set of variables are called cointegrated if a linear combination is stationary.
• Many time series (spot vs. futures, exchange rates) in finance and economics move
together.
• While in the short-run, they can go apart, in the long-run fundamental forces of the
market bring them together.
• It is a long-term equilibrium phenomenon.
INDIAN INSTITUTE OF TECHNOLOGY KANPUR
• Of course, the error correction term appears with lags (t-1); otherwise,
it would indicate that changes in y from t-1 to t are driven by
disequilibrium in the long-term relation at t.
• Gamma (ϒ) coefficient here defines the long-run relationship between x
and y.
• 𝛽1 describes the short-run relationship (first differences), and 𝛽2
describes the speed of adjustment toward equilibrium.
• This discussion can be extended to a system of more than two
variables.
INDIAN INSTITUTE OF TECHNOLOGY KANPUR