Slide 1 A
Slide 1 A
Markets
1a. Linear Time Series Analysis
Simon Kwok
University of Sydney
Semester 1, 2022
1 / 19
Outline
1. AR Model
1.1 Model Properties
1.2 Autocorrelation Function (ACF)
1.3 Model Estimation
1.4 Model Selection
1.5 Goodness-of-…t
1.6 Forecasting
2 / 19
Autoregressive (AR) Model
yt = φ0 + φ1 yt 1 + φ2 yt 2 + + φp yt p + εt ,
3 / 19
AR Model
yt = µ + ut ,
p
ut = ∑ φi ut i + εt . (2)
i =1
[1 φ(L)] ut = εt .
4 / 19
Autocovariance and Autocorrelation Functions
Suppose fyt g is covariance stationary.
I For a given integer j, the lag-j autocovariance function is
de…ned as
γj = Cov (yt , yt j ).
In particular, the variance is γ0 = Var (yt ).
I For a given integer j, the lag-j autocorrelation function (ACF)
is de…ned as
Cov (yt , yt j ) γj
ρj = Corr (yt , yt j) = = .
Var (yt ) γ0
By convention, ρ0 1.
Both the autocovariance function and ACF are symmetric
functions: γj = γ j and ρj = ρ j .
5 / 19
AR(1) Model
AR (1) model:
yt = µ + ut ,
ut = φ1 ut 1 + εt . (3)
E (u t u t j) = φ1 E (u t 1 u t j ) + E ( εt u t j )
γj = φ1 γj 1. (4)
Note that E (εt u t j) = E [E (εt jFs )u t j] = 0. (4) is the Yule-Walker equation of AR(1).
σ2ε σ2ε φ1
Set j = 1: γ1 = φ1 γ0 . As γ0 = Var (u t ) = 1 φ21
, we can solve for γ1 : γ1 = 1 φ21
.
j
σ2ε φ1
For j > 1, γj = φ1 γj 1. By recursive substitution, we have γj = 1 φ21
.
jj j
σ2ε φ1
By symmetry, the lag-j autocovariance function is γj = 1 φ21
for all integers j .
6 / 19
ACF of AR(1)
γj
Recall that the ACF is ρj = γ0 .
The ACF of AR (1) is
jj j
,
σ2ε φ1 σ2ε
ρj =
1 φ21 1 φ21
jj j
= φ1
7 / 19
ACF of AR(1)
8 / 19
ACF of AR(2)
Let yt AR (2): yt = µ + ut and ut = φ1 ut 1 + φ2 ut 2 + εt .
Ex: Show that the autocovariance function is
σ2ε
γ0 = (1 φ2 ),
D
σ2ε
γ1 = φ ,
D 1
γj = φ1 γj 1 + φ2 γj 2 for j 2,
γ j = γj ,
9 / 19
ACF of AR(2)
The polynomial function of AR (2) is φ (x ) = φ1 x + φ2 x 2 .
Consider the polynomial equation
1 φ (x ) = 0
φ2 x 2 = 0.
1 φ1 x
p 2
φ1 φ1 +4φ2
The equation has two roots x = 2φ .
2
I When the roots are real (φ21 + 4φ2 0), the ACF decays
smoothly.
I When the roots are complex (φ21 + 4φ2 < 0), the ACF is
2π p
oscillating with an average period k = 1
.
cos (φ1 /2 φ2 )
Let the complex roots be a ib. The period kpcan be solved from
φ21 4φ2
cos ( 2π p a
φ1
k ) = a 2 +b 2
, where a = 2φ
2
and b = 2φ 2
.
10 / 19
ACF of AR(2)
11 / 19
PACF
Consider the following regressions:
2p
AIC = ln(σ̃2p ) + + constant,
T
p ln(T )
BIC = ln(σ̃2p ) + + constant,
T
where σ̃2p is the maximum likelihood estimate of the error variance:
σ̃2p = T1 ∑Tt=p +1 ε̂2t .
14 / 19
Goodness-of-…t
SSE ∑T 2
t =p +1 ε̂t
I R2 = 1 SST =1 T .
∑t =p +1 t ȳ )2
( y
By SST = SSR + SSE, we have 0 R2 1.
1 T 2
T 2p 1 ∑t =p +1 ε̂t σ̂2ε
I Adjusted R 2 = 1 1 T =1 σ̂2y
, where σ̂2y is
T p 1 ∑t =p +1 (y t ȳ )
2
15 / 19
Time Series Forecasting
The `-step ahead forecast ŷt (`) is obtained by minimizing the
conditional mean squared error:
Var [et (2)] = φ21 Var (εt +1 ) + Var (εt +2 ) + 2φ1 Cov (εt +1 , εt +2 )
= φ21 σ2ε + σ2ε + 0
= (1 + φ21 )σ2ε .
18 / 19
Forecasting with AR model
19 / 19