You are on page 1of 31

Business Forecasting

ECON2209
Slides 06

Lecturer: Minxian Yang

BF-06

my, School of Economics, UNSW

Ch.8 Modelling Cycles

Lecture Plan
Big picture:

yt = mt + st + xt ,

st + p = st ,

s
k =1

t +k

= 0,

E( xt ) = 0

Cycle is regarded as a stochastic processes (SP).


It need to be made operational.

Theoretical models for stationary SP


moving average (MA) models
autoregressive (AR) models
mixed ARMA models

Simplified descriptions
of time series that can
be used for forecasting

Characteristics of theoretical models


Stationarity and invertability
ACF and PACF patterns
BF-06

my, School of Economics, UNSW

Model patterns that


need to be matched to
patterns in data

Ch.8 Modelling Cycles

Modelling Cycles (Ch.8)


Notation change:
We use yt for the cycle component in this chapter.
Assume that yt is observable.

Modelling
It is the process of matching the characteristics of
the cycle (sample) with those of a theoretical
model.
Once matched, the model allows us to describe
and forecast the cycle component.
BF-06

my, School of Economics, UNSW

Ch.8 Modelling Cycles

Lag operation
To handle yt, yt-1, yt-2, ... in time series analysis, the
lag operator L is a useful tool.
Lag operator:
Lead:

Lyt = yt 1 ,

L1 yt = yt +1 ,

Lag polynomial:
eg. Lc = ?

L k yt = yt + k ,

k = 0,1,2,....

The lag of a constant is the constant itself.

A( L) = ai L ,
i

BF-05

k = 0,1,2,....

B ( L) = b0 + b1 L + + bm Lm

B( L) = 1 0.8 L + 0.1L2 ,

i =0

Lk yt = yt k ,

B( L) yt = yt 0.8 yt 1 + 0.1 yt 2 .

A( L) yt = ai yt i = a0 yt + a1 yt 1 + a2 yt 2 + .
i =0

my, School of Economics, UNSW

Ch.8 Modelling Cycles

Lag polynomial
Let A( L) = a0 + a1 L + ak Lk . Then
A(L)yt = a0yt + a1yt-1 ++ akyt-k.
A(L)c = a0c + a1c ++ akc = A(1)c.

The lags of a constant


are the constant itself.

The roots of A(L) = 0 are the values of L that makes


A(L) zero.
Usual algebra applies. For example,
(a0 + a1 L)(b0 + b1 L) = (a0 + a1 L)b0 + (a0 + a1 L)b1 L
= a0b0 + (a1b0 + a0b1 ) L + a1b1 L2 .

[A(L)]-1 is defined as the polynomial B(L) such that


B(L)A(L) = 1. For example: (1 a1L) 1 = 1 + (a1L) + (a1L) 2 + (a1L)3 +
BF-06

my, School of Economics, UNSW

Ch.8 Modelling Cycles

Moving average (MA) models


Let {yt} be stationary. Wold theorem says that it is
a linear combination of a WN process:

yt = bi t i ,
i =0

t ~ WN(0, 2 ).

It must hold that bi 0 as i , as


MA(q), a 1-sided MA of white noises,
yt = t + 1 t 1 + + q t q ,

2
b
i < .
i =0

t ~ iid WN(0, 2 ).

is a special case of Wold, with bi = 0 for i > q.


MA(q) is a always stationary.
Parameters (1, , q, 2) need to be estimated.
BF-06

my, School of Economics, UNSW

Ch.8 Modelling Cycles

MA(1)
MA(1) model
yt = t + t 1 = (1 + L) t ,

t ~ iid WN(0, 2 ).

Unconditional moments
2 , if = 1
Cov( yt , yt ) =
.
if > 1
0,

E( yt ) = 0, Var( yt ) = (1 + ) ,
2

eg.
MA(1): theta = -0.9

MA(1): theta = 0, White Noise

MA(1): theta = 0.9

1
0

0
0

-1

-1
-1

-2
-3

-2

-4

-3

-5

-3

-4
25

BF-06

-2

50

75

100

125

150

175

200

-4
25

50

75

100

125

150

175

my, School of Economics, UNSW

200

25

50

75

100

125

150

175

200

Ch.8 Modelling Cycles

MA(1)

eg. = 0.5

ACF: cut-off at = 1 .
( ) /(1 + 2 ), if = 1
.
=
( ) =
(0) 0,
if > 1

1+ L = 0 implies L = - 2.
We treat L as a complex
number here.

The parameter is not identified by ACF.


eg. Both =.5 and =2 induce the same ACF.

Invertible MA(1)
It is invertible if the root of
1+ L = 0 is outside
the unit circle (or || < 1).
When invertible, is identified by ACF,
and PACF decays to zero exponentially.
BF-06

my, School of Economics, UNSW

I
1

-1

-1

Ch.8 Modelling Cycles

MA(1)

Conditional
mean is time-varying.

Conditional moments
Let t-1 = {t-1, t-2, }.
E( yt | t 1 ) = t 1 , Var( yt | t 1 ) = 2 .

Conditional variance
is smaller than
unconditional.

Using {yt-1, yt-2, } to compute t-1.


0 = 0
To forecast yt based on t-1,
1 = y1 0 ,
we need to find from the
2 = y2 1 = y2 y1 + 0 ,

t-1

observable {yt-1, yt-2, }.

t 1 = yt 1 t 2 = yt 1 yt 2 + ... + ( )t 2 y1 + ( )t 1 0 .
If invertible, the effect of 0 diminishes to zero quickly.
BF-06

my, School of Economics, UNSW

Ch.8 Modelling Cycles

MA(q)
MA(q) model

yt = t + 1 t 1 + + q t q = ( L) t ,

t ~ iid WN(0, 2 ), ( L) = (1 + 1 L + + q Lq ).

Unconditional moments

E( yt ) = 0, Var( yt ) = (1 + 12 + + q2 ) 2 .

Cov( yt , yt

eg.

BF-06

( + +11 + + q q ) 2 , if 1 < q

) = q 2 ,
.
if = q
0,
if > q

MA(2) : yt = t + 1 t 1 + 2 t 2 ,

(0) = (1 + 12 + 22 ) 2 ,

(1) = (1 + 21 ) 2 ,

(2) = 2 2 ,

( ) = 0, for > 2.
my, School of Economics, UNSW

MA(q) process
is always covariance
stationary.

10

MA(q)

When these match


data ACF/PACF,
MA(q) is a candidate model.

Ch.8 Modelling Cycles


0.8

0.4

ACF: cut-off at = q.
( )
( ) =
= 0, if > q.
(0)

0.0

-0.4

-0.8

These
could be all
positive.

Invertible MA(q):
The roots of (L) = 0 are outside the unit circle.
For invertible MA(q), (L) is identified.
-1.2

10 11 12

Cutoff at Lag 5

0.8

If the MA(q) is invertible,


PACF decays to zero
exponentially.

0.4

0.0

-0.4

-0.8

-1.2
1

10 11 12

Exponential Decay

BF-06

my, School of Economics, UNSW

11

Ch.8 Modelling Cycles

MA(q)

Conditional
mean is time-varying.

Conditional moments
Conditional variance
is smaller...
Let t-1 = {t-1, t-2, }.
E( yt | t 1 ) = 1 t 1 + + q t q , Var( yt | t 1 ) = 2 .
Using {yt-1, yt-2, } to compute t-1.
0 = 1 = = 1q = 0

To forecast yt based on t-1,


1 = y1 ,
we need to find t-1 from the
2 = y2 1 1 ,
observable {yt-1, yt-2, }.

t 1 = yt 1 1 t 2 2 t 3 q t 1q .

If invertible, the effect of 0, -1, goes to zero quickly.


BF-06

my, School of Economics, UNSW

12

Ch.8 Modelling Cycles

Autoregressive (AR) Models


In AR models, the current yt is determined by its
lags and an unobserved shock (WN):
yt = 1 yt 1 + + p yt p + t ,

t ~ iid WN(0, 2 ),

where, (1, , p, 2) are parameters.


AR models are always invertible, since t can be
recovered from observed yt , yt-1 , , yt-p for any
given parameter values.
The estimation of AR models can be easily done
by OLS.
BF-06

my, School of Economics, UNSW

13

Ch.8 Modelling Cycles

AR(1)

AR(1) process
yt = yt 1 + t ,

t ~ iid WN(0, 2 ).

present = history + disturbance.


Parameters: (, 2).
Backward substitution
yt = t + ( t 1 + yt 2 ) =

Whether or not
yt is stationary depends
on parameter .

= t + t 1 + + t 1 1 + t y0 .

Stationary AR(1): || < 1 or


The root of 1L = 0 is outside the unit circle.
BF-06

my, School of Economics, UNSW

14

Ch.8 Modelling Cycles

AR(1)

eg. Which one is likely non-stationary?


AR(1): phi = 0, White Noise

AR(1): phi = 0.9

1
0

-1

-2

-2

-4

-3
-4

-6
25

50

75

100

125

150

175

200

25

50

AR(1): phi = 0.5

75

100

125

150

175

200

150

175

200

AR(1): phi = 1

10

2
5
1
0

-1
-5
-2
-3

-10
25

BF-06

50

75

100

125

150

175

200

my, School of Economics, UNSW

25

50

75

100

125

15

Ch.8 Modelling Cycles

AR(1)
When stationary, AR(1) has a Wold representation
yt = t + t 1 + 2 t 2 +

= i t i = (1 L) 1 t .

Here the coefficients in Wold, bi ,


are restricted to be bi = i .

i =0

Unconditional moments

exponential decay

2
2
E( yt ) = 0, Var( yt ) =
, Cov( yt , yt ) =
.
2
2
1
1

Conditional moments with t-1 = {yt-1, yt-2, }


E( yt | t 1 ) = yt 1 , Var( yt | t 1 ) = 2 .

BF-06

my, School of Economics, UNSW

16

Ch.8 Modelling Cycles

AR(1)
ACF: exponential decay
( ) =

( )
= , for = 0,1,2,....
(0)

PACF: cut-off at = 1
,
pacf ( ) =
0,

BF-06

if = 1
.
if > 1

my, School of Economics, UNSW

When these match


data ACF/PACF,
AR(1) is a candidate
model.

17

Ch.8 Modelling Cycles

AR(p)
AR(p) process
yt = 1 yt 1 + + p yt p + t ,
( L ) yt = t ,

t ~ iid WN(0, 2 ),

( L) = 1 1 L p Lp .

Parameters: (1, ,p , 2).


Stationary AR(p) process
The roots of (L)= 0 are outside the unit circle.
When stationary, AR(p) has a Wold representation

yt = ( L) t = bi t i ,
1

i =0

b0 = 1,

where bi depends on (1, ,p), decays to zero


exponentially as i increases.
BF-06

my, School of Economics, UNSW

18

Ch.8 Modelling Cycles

AR(p)
Unconditional moments (when stationary)

E ( yt ) = 0, Var ( yt ) = bi2 2 ,
i =0

Cov( yt , yt ) = bi bi + 2 .
i =0

Conditional moments with t-1 = {yt-1, yt-2, }


E( yt | t 1 ) = 1 yt 1 + + p yt p , Var( yt | t 1 ) = 2 .

What if yt = c + 1 yt 1 + + p yt p + t ?
E ( yt ) =

BF-06

c
,
1 1 p

E( yt | t 1 ) = c + 1 yt 1 + + p yt p .

my, School of Economics, UNSW

19

Ch.8 Modelling Cycles

AR(p)

0.8

ACF:
exponential decay

0.4

0.0

-0.4

-0.8

-1.2
1

10 11 12

Exponential Decay

PACF:
cut-off at = p

These
could be all
positive.

0.8

0.4

0.0

-0.4

-0.8

-1.2
1

10 11 12

Cutoff at Lag 5

BF-06

my, School of Economics, UNSW

20

Ch.8 Modelling Cycles

ARMA models
AR mixed with MA:
Y-present = Y-history + MA of disturbances
AR
+
MA
Aggregation of AR processes leads to ARMA.
Observing an AR with measurement errors leads to
ARMA.
ARMA may be more parsimonious than pure AR or MA.

BF-06

my, School of Economics, UNSW

21

Ch.8 Modelling Cycles

ARMA(1,1)
ARMA(1,1) model
yt = yt 1 + t + t 1 ,
or
( L) yt = ( L) t ,

t ~ iid WN(0, 2 ).

( L) = 1 L,

( L) = 1 + L.

Parameters: (, , 2).
Backward substitution
yt = t + t 1 + ( t 1 + t 2 + yt 2 ) =
= t + t 1 + ( t 1 + t 2 ) + + t 1 ( 1 + 0 ) + t y0 .

BF-06

my, School of Economics, UNSW

22

Ch.8 Modelling Cycles

ARMA(1,1)
Stationary ARMA(1,1): || < 1 or
The root of 1L = 0 is outside the unit circle.
Invertible ARMA(1,1): || < 1 or
The root of 1+L = 0 is outside the unit circle.
When stationary & invertible,

BF-06

yt = [ ( L)]1 ( L) t ,

(Wold)

t = [( L)]1 ( L) yt .

(recover t )

my, School of Economics, UNSW

23

Ch.8 Modelling Cycles

ARMA(1,1)
What if = ?
The common roots in (L) = 0 and (L) = 0
lead to unidentified parameters. Undesirable!
Stationary invertible ARMA with no common root
is a well-defined model.
ACF and PACF of ARMA (when stationary & invertible)
Both decay to zero exponentially.

BF-06

my, School of Economics, UNSW

24

Ch.8 Modelling Cycles

ARMA(1,1)
Unconditional moments (when stationary)
( + ) 2 2
.
E( yt ) = 0, Var( yt ) = 1 +
2
1

eg. yt = yt-1 + t-1 + t , Expectation Rule 7 and stationarity.


var (yt) = var (yt-1 + t-1) + var (t) = var (yt-1 + t-1) + 2;
yt-1 + t-1 = (yt-2 + t-2) + ( + ) t-1;
var (yt-1 + t-1) = 2var(yt-2 + t-2) + ( + )2 2.

Conditional moments with t-1 = {yt-1, yt-2, }


E( yt | t 1 ) = yt 1 + t 1 , Var( yt | t 1 ) = 2 .

BF-06

my, School of Economics, UNSW

25

Ch.8 Modelling Cycles

ARMA(p,q)
ARMA(p,q) model
( L) yt = ( L) t ,

t ~ iid WN(0, 2 ),

( L) = 1 1 L p Lp ,

( L) = 1 + 1 L + + q Lq .

or
yt = 1 yt 1 + + p yt p + t + 1 t 1 + + q t q .

Parameters: (1,, p, 1,, q, 2).


Stationary ARMA(p,q):
The roots of (L)= 0 are outside the unit circle.
Invertible ARMA(p,q):
The roots of (L) = 0 are outside the unit circle.
BF-06

my, School of Economics, UNSW

26

Ch.8 Modelling Cycles

ARMA(p,q)
When stationary, Wold holds

yt = ( L) ( L) t = bi t i ,
1

i =0

b0 = 1.

where bi depends on (1, , p , 1,, q), decays


to zero exponentially as i increases.
When invertible, disturbance can be recovered
t = ( L) 1 ( L) yt .

Well defined ARMA model: stationary, invertible,


no common roots.
BF-06

my, School of Economics, UNSW

27

Ch.8 Modelling Cycles

ARMA(p,q)
Unconditional moments (when stationary)

E ( yt ) = 0, Var ( yt ) = bi2 2 ,
i =0

Cov( yt , yt ) = bi bi + 2 .
i =0

Conditional moments with t-1 = {yt-1, yt-2, }


E( yt | t 1 ) = 1 yt 1 + + p yt p + 1 t 1 + + q t q ,
Var ( yt | t 1 ) = 2 .

Again, conditional
variance is smaller than
unconditional.

When stationary & invertible,


ACF & PACF both decay to zero exponentially.
BF-06

my, School of Economics, UNSW

28

Ch.8 Modelling Cycles

ARMA(p,q)
What if data say E(yt) = 0?
Either write
yt = + xt ,

( L) xt = ( L) t .

(estimation requires nonlinear LS or ML)


Or

yt = c + 1 yt + + p yt p + t + 1 t 1 + + q t q ,

i.e.
( L) yt = c + ( L) t with c = (1) .

(OLS is only applicable for pure AR)


BF-06

my, School of Economics, UNSW

29

Ch.8 Modelling Cycles

Simulation in EViews
'Can be saved in simulation.prg

'Generate AR(1) with start value y0=0


series yar=0
smpl @first+1 @last
genr yar=0 + 0.9*yar(-1) + eps

'Create a workfile, undated, 500 obs


wfcreate(wf=simulate) u 500
'Set random seed
'(so that you can replicate results)
rndseed 917531
'Sample from the first period to the last
smpl @first @last
'Generate iid Normal(0,1) white noise process
series eps=nrnd

'Generate MA(1)
series yma=0
smpl @first+1 @last
genr yma=0 - 0.9*eps(-1) + eps
'Plot the first 200 observations and ACF/PACF
smpl @first 200
yar.line
yar.correl(15)
yma.line
yma.correl(15)

BF-06

my, School of Economics, UNSW

30

Ch.8 Modelling Cycles

Summary
What are MA, AR and ARMA models? Why are we
interested in them?
What are the patters of ACF/PACF in MA, AR and
ARMA models?
Why is MA(q) always stationary and AR(p) always
invertible?
What is a common root in an ARMA model?
Why conditional variances are smaller than
unconditional ones?
Why are conditional means time varying?
BF-06

my, School of Economics, UNSW

31

You might also like