BF-06

31
Business Forecasting ECON2209 Slides 06 Lecturer: Minxian Yang BF-06 1 my, School of Economics, UNSW

description

slides

Transcript of BF-06

Page 1: BF-06

Business Forecasting ECON2209

Slides 06

Lecturer: Minxian Yang

BF-06 1 my, School of Economics, UNSW

Page 2: BF-06

Ch.8 Modelling Cycles

• Lecture Plan – Big picture:

• 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

– Characteristics of theoretical models • Stationarity and invertability • ACF and PACF patterns

BF-06 my, School of Economics, UNSW 2

0)(E ,0 , ,1

===++= ∑=

++ t

p

kkttpttttt xsssxsmy

Simplified descriptions of time series that can be used for forecasting

Model patterns that need to be matched to

patterns in data

Page 3: BF-06

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 3

Page 4: BF-06

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:

– Lag polynomial:

eg. Lc = ?

BF-05 my, School of Economics, UNSW 4

,....2,1,0,,1 === −− kyyLyLy kttk

tt

,....2,1,0,,11 === +

−+

− kyyLyyL kttk

tt

mmLbLbbLB +++= 10)(

.1.08.0)(,1.08.01)( 212

−− +−=+−= tttt yyyyLBLLLB

The lag of a constant is the constant itself.

.)(,)( 2211000

+++=== −−

=−

=∑∑ ttti

ititi

ii yayayayayLALaLA

Page 5: BF-06

Ch.8 Modelling Cycles

• Lag polynomial Let Then – A(L)yt = a0yt + a1yt-1 +…+ akyt-k. – A(L)c = a0c + a1c +…+ akc = A(1)c.

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

– Usual algebra applies. For example,

– [A(L)]-1 is defined as the polynomial B(L) such that B(L)A(L) = 1. For example:

BF-06 my, School of Economics, UNSW 5

.)( 10k

k LaLaaLA ++=

.)(

)()())((2

11100100

1100101010

LbaLbababaLbLaabLaaLbbLaa

+++=

+++=++

The lags of a constant are the constant itself.

++++=− − 31

211

11 )()()(1)1( LaLaLaLa

Page 6: BF-06

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:

It must hold that bi → 0 as i → ∞, as – MA(q), a 1-sided MA of white noises,

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 6

).,0(WN~, 2

0σεε t

iitit by ∑

=−=

).,0( WNiid~ , 211 σεεθεθε tqtqttty −− +++=

.0

2 ∞<∑∞

=iib

Page 7: BF-06

Ch.8 Modelling Cycles

• MA(1) – MA(1) model

– Unconditional moments

eg.

BF-06 my, School of Economics, UNSW 7

).,0( WNiid~,)1( 21 σεεθθεε ttttt Ly +=+= −

,)1()Var( ,0)E( 22 σθ+== tt yy .1 if 0,1 if ,

),Cov(2

>=

=− ττθσ

τtt yy

-5

-4

-3

-2

-1

0

1

2

3

4

25 50 75 100 125 150 175 200

MA(1): theta = -0.9

-4

-3

-2

-1

0

1

2

3

4

25 50 75 100 125 150 175 200

MA(1): theta = 0, White Noise

-4

-3

-2

-1

0

1

2

3

25 50 75 100 125 150 175 200

MA(1): theta = 0.9

Page 8: BF-06

Ch.8 Modelling Cycles

• MA(1) – ACF: cut-off at τ = 1 .

– 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 8

.1 if 0,1 if ),1/(

)0()()(

2

>=+

==ττθθ

γτγτρ

0

1

-1

-1 1 R

I

eg. θ = 0.5

1+ θL = 0 implies L = - 2.

We treat L as a complex number here.

Page 9: BF-06

Ch.8 Modelling Cycles

• MA(1) – Conditional moments Let Ωt-1 = εt-1, εt-2, ….

– Using yt-1, yt-2, … to compute εt-1.

If invertible, the effect of ε0 diminishes to zero quickly.

BF-06 my, School of Economics, UNSW 9

.)|Var( ,)|E( 2111 σθε =Ω=Ω −−− ttttt yy

.)(y)(...yyy

,yyy,y

ttttttt 0

11

221211

02

12122

011

0

0

εθθθθεε

εθθθεε

θεεε

−−−−−−− −+−++−=−=

+−=−=

−==

To forecast yt based on Ωt-1, we need to find εt-1 from the observable yt-1, yt-2, ….

Conditional mean is time-varying.

Conditional variance is smaller than unconditional.

Page 10: BF-06

Ch.8 Modelling Cycles

• MA(q) – MA(q) model

– Unconditional moments

– eg.

BF-06 my, School of Economics, UNSW 10

).1()(),,0( WNiid~

,)(

12

11

qqt

tqtqttt

LLL

Ly

θθσε

εεθεθε

+++=Θ

Θ=+++= −−

.)1()Var( ,0)E( 2221 σθθ qtt yy +++==

.qq

q,)()y,y q

qq

tt

>=

<≤+++=

−+

ττσθ

τσθθθθθ τττ

τ

if 0, if ,1 if

Cov( 2

211

.2for ,0)( ,)2(

,)()1( ,)1()0(

, :MA(2)

22

2121

222

21

2211

>==

+=++=

++= −−

ττγσθγ

σθθθγσθθγ

εθεθε ttttyMA(q) process

is always covariance stationary.

Page 11: BF-06

Ch.8 Modelling Cycles

• MA(q) – ACF: cut-off at τ = q.

– Invertible MA(q): The roots of “Θ(L) = 0” are outside the unit circle. For invertible MA(q), Θ(L) is identified.

– If the MA(q) is invertible, PACF decays to zero exponentially.

BF-06 my, School of Economics, UNSW 11

. if ,0)0()()( q>== τ

γτγτρ

-1.2

-0.8

-0.4

0.0

0.4

0.8

1 2 3 4 5 6 7 8 9 10 11 12

Cutoff at Lag 5

-1.2

-0.8

-0.4

0.0

0.4

0.8

1 2 3 4 5 6 7 8 9 10 11 12

Exponential Decay

These could be all

positive.

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

Page 12: BF-06

Ch.8 Modelling Cycles

• MA(q) – Conditional moments Let Ωt-1 = εt-1, εt-2, ….

– Using yt-1, yt-2, … to compute εt-1.

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

BF-06 my, School of Economics, UNSW 12

.)|Var( ,)|E( 21111 σεθεθ =Ω++=Ω −−−− ttqtqttt yy

.

,,

0

1322111

1122

11

110

qtqtttt

q

y

yy

−−−−−−

−−

−−−−=

−==

====

εθεθεθε

εθεε

εεε

To forecast yt based on Ωt-1, we need to find εt-1 from the observable yt-1, yt-2, ….

Conditional mean is time-varying.

Conditional variance is smaller...

Page 13: BF-06

Ch.8 Modelling Cycles

• Autoregressive (AR) Models – In AR models, the current yt is determined by its

lags and an unobserved shock (WN):

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

),,0( WNiid~, 211 σεεϕϕ ttptptt yyy +++= −−

Page 14: BF-06

Ch.8 Modelling Cycles

• AR(1) – AR(1) process

present = history + disturbance. Parameters: (φ, σ2).

– Backward substitution

– Stationary AR(1): |φ| < 1 or The root of “1−φL = 0” is outside the unit circle.

BF-06 my, School of Economics, UNSW 14

).,0( WNiid~, 21 σεεϕ tttt yy += −

.

)(

011

1

21

yyy

tttt

tttt

ϕεϕϕεε

ϕεϕε

++++=

=++=−

−−

Whether or not yt is stationary depends

on parameter φ.

Page 15: BF-06

Ch.8 Modelling Cycles

• AR(1) eg. Which one is likely non-stationary?

BF-06 my, School of Economics, UNSW 15

-4

-3

-2

-1

0

1

2

3

4

25 50 75 100 125 150 175 200

AR(1): phi = 0, White Noise

-3

-2

-1

0

1

2

3

25 50 75 100 125 150 175 200

AR(1): phi = 0.5

-6

-4

-2

0

2

4

6

25 50 75 100 125 150 175 200

AR(1): phi = 0.9

-10

-5

0

5

10

25 50 75 100 125 150 175 200

AR(1): phi = 1

Page 16: BF-06

Ch.8 Modelling Cycles

• AR(1) – When stationary, AR(1) has a Wold representation

– Unconditional moments

– Conditional moments with Ωt-1 = yt-1, yt-2, …

BF-06 my, School of Economics, UNSW 16

.)1( 1

0

22

1

ti

iti

tttt

L

y

εϕεϕ

εϕϕεε

−∞

=−

−−

−==

+++=

.1

),Cov( ,1

)Var( ,0)E( 2

2

2

2

ϕσϕ

ϕσ τ

τ −=

−== −tttt yyyy

.)|Var( ,)|E( 2111 σϕ =Ω=Ω −−− ttttt yyy

Here the coefficients in Wold, bi , are restricted to be bi = φi .

exponential decay

Page 17: BF-06

Ch.8 Modelling Cycles

• AR(1) – ACF: exponential decay

– PACF: cut-off at τ = 1

BF-06 my, School of Economics, UNSW 17

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

γτγτρ τ

.1 if 0,1 if ,

)(pacf

>=

=ττϕ

τ

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

Page 18: BF-06

Ch.8 Modelling Cycles

• AR(p) – AR(p) process

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

where bi depends on (φ1, …,φp), decays to zero exponentially as i increases.

BF-06 my, School of Economics, UNSW 18

.1)(,)(

),,0( WNiid~,

1

211

pptt

ttptptt

LLLyL

yyy

ϕϕε

σεεϕϕ

−−−=Φ=Φ

+++= −−

,1,)( 00

1 === ∑∞

=−

− bbLΦyi

ititt εε

Page 19: BF-06

Ch.8 Modelling Cycles

• AR(p) – Unconditional moments (when stationary)

– Conditional moments with Ωt-1 = yt-1, yt-2, …

– What if

BF-06 my, School of Economics, UNSW 19

,)(Var ,0)(E0

22∑∞

=

==i

itt byy σ

.),(Cov0

2∑∞

=+− =

iiitt bbyy σττ

.)|Var( ,)|E( 21111 σϕϕ =Ω++=Ω −−−− ttptpttt yyyy

?11 tptptt yycy εϕϕ ++++= −−

,1

)(E1 p

tcy

φφ −−−=

.)Ω|(E 111 ptpttt yycy −−− +++= φφ

Page 20: BF-06

Ch.8 Modelling Cycles

• AR(p) – ACF: exponential decay

– PACF: cut-off at τ = p

BF-06 my, School of Economics, UNSW 20

-1.2

-0.8

-0.4

0.0

0.4

0.8

1 2 3 4 5 6 7 8 9 10 11 12

Cutoff at Lag 5

-1.2

-0.8

-0.4

0.0

0.4

0.8

1 2 3 4 5 6 7 8 9 10 11 12

Exponential Decay These could be all

positive.

Page 21: BF-06

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

Page 22: BF-06

Ch.8 Modelling Cycles

• ARMA(1,1) – ARMA(1,1) model

Parameters: (φ, θ, σ2).

– Backward substitution

BF-06 my, School of Economics, UNSW 22

.1)(,1)(,)()(or

).,0( WNiid~, 211

LLLLLyL

yy

tt

ttttt

θϕε

σεθεεϕ

+=Θ−=ΦΘ=Φ

++= −−

.)()(

)(

0011

211

2211

yyy

tttttt

tttttt

ϕθεεϕθεεϕθεε

ϕθεεϕθεε

+++++++=

=++++=−

−−−

−−−−

Page 23: BF-06

Ch.8 Modelling Cycles

• ARMA(1,1) – Stationary ARMA(1,1): |φ| < 1 or The root of “1−φL = 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 my, School of Economics, UNSW 23

)(recover .)()]([

(Wold) ,)()]([1

1

ttt

tt

yLLLLy

εε

ε

ΦΘ=

ΘΦ=−

Page 24: BF-06

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

Page 25: BF-06

Ch.8 Modelling Cycles

• ARMA(1,1) – Unconditional moments (when stationary)

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, …

BF-06 my, School of Economics, UNSW 25

.1

)(1)Var( ,0)E( 22

2

σϕθϕ

−+

+== tt yy

.)|Var( ,)|E( 21111 σθεϕ =Ω+=Ω −−−− tttttt yyy

Page 26: BF-06

Ch.8 Modelling Cycles

• ARMA(p,q) – ARMA(p,q) model

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

.1)(,1)(

),,0( WNiid~,)()(

11

2

qq

pp

ttt

LLLLLLLyL

θθϕϕ

σεε

+++=Θ−−−=Φ

Θ=Φ

.or

1111 qtqttptptt yyy −−−− ++++++= εθεθεϕϕ

Page 27: BF-06

Ch.8 Modelling Cycles

• ARMA(p,q) – When stationary, Wold holds

where bi depends on (φ1, …, φp , θ1,…, θq), decays

to zero exponentially as i increases.

– When invertible, disturbance can be recovered

– Well defined ARMA model: stationary, invertible, no common roots.

BF-06 my, School of Economics, UNSW 27

.1,)()( 00

1 ==ΘΦ= ∑∞

=−

− bbLLyi

ititt εε

.)()( 1tt yLL ΦΘ= −ε

Page 28: BF-06

Ch.8 Modelling Cycles

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

– Conditional moments with Ωt-1 = yt-1, yt-2, …

– When stationary & invertible, ACF & PACF both decay to zero exponentially.

BF-06 my, School of Economics, UNSW 28

,)(Var ,0)(E0

22∑∞

=

==i

itt byy σ

.),(Cov0

2∑∞

=+− =

iiitt bbyy σττ

.)|(Var

,)|(E2

1

11111

σ

εθεθϕϕ

+++++=Ω

−−−−−

tt

qtqtptpttt

y

yyy

Again, conditional variance is smaller than

unconditional.

Page 29: BF-06

Ch.8 Modelling Cycles

• ARMA(p,q) – What if data say E(yt) = μ ≠ 0? Either write

(estimation requires nonlinear LS or ML) Or

(OLS is only applicable for pure AR)

BF-06 my, School of Economics, UNSW 29

.)()(, tttt LxLxy εµ Θ=Φ+=

.)1( with )()(..

,111

µε

εθεθεϕϕ

Φ=Θ+=Φ

+++++++= −−−

cLcyLei

yycy

tt

qtqttptptt

Page 30: BF-06

Ch.8 Modelling Cycles

• Simulation in EViews

BF-06 my, School of Economics, UNSW 30

'Can be saved in “simulation.prg” '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 AR(1) with start value y0=0 series yar=0 smpl @first+1 @last genr yar=0 + 0.9*yar(-1) + eps '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)

Page 31: BF-06

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