State-space Title models and the Pawel Zabczyk Kalman filter - - PowerPoint PPT Presentation

state space
SMART_READER_LITE
LIVE PREVIEW

State-space Title models and the Pawel Zabczyk Kalman filter - - PowerPoint PPT Presentation

Centre for Central Banking Studies Date Nairobi, April 26, 2016 State-space Title models and the Pawel Zabczyk Kalman filter pawel.zabczyk@bankofengland.co.uk The Bank of England does not accept any liability for misleading or inaccurate


slide-1
SLIDE 1

Centre for Central Banking Studies

State-space models and the Kalman filter

Date Nairobi, April 26, 2016 Title Pawel Zabczyk pawel.zabczyk@bankofengland.co.uk

The Bank of England does not accept any liability for misleading or inaccurate information or omissions in the information provided.

slide-2
SLIDE 2

Centre for Central Banking Studies Modelling and Forecasting 2

State space models are useful/crucial for applied research

Can be used to

  • measure how a relationship between variables changes
  • ver time
  • decompose a time-series into a cycle and trend component
  • determine if a common component is driving a group of

time series

  • calculate the likelihood function for many models (including

DSGE’s)

slide-3
SLIDE 3

Centre for Central Banking Studies Modelling and Forecasting 2

State space models are useful/crucial for applied research

Can be used to

  • measure how a relationship between variables changes
  • ver time
  • decompose a time-series into a cycle and trend component
  • determine if a common component is driving a group of

time series

  • calculate the likelihood function for many models (including

DSGE’s)

slide-4
SLIDE 4

Centre for Central Banking Studies Modelling and Forecasting 2

State space models are useful/crucial for applied research

Can be used to

  • measure how a relationship between variables changes
  • ver time
  • decompose a time-series into a cycle and trend component
  • determine if a common component is driving a group of

time series

  • calculate the likelihood function for many models (including

DSGE’s)

slide-5
SLIDE 5

Centre for Central Banking Studies Modelling and Forecasting 2

State space models are useful/crucial for applied research

Can be used to

  • measure how a relationship between variables changes
  • ver time
  • decompose a time-series into a cycle and trend component
  • determine if a common component is driving a group of

time series

  • calculate the likelihood function for many models (including

DSGE’s)

slide-6
SLIDE 6

Centre for Central Banking Studies Modelling and Forecasting 3

State space models

Observation equation

  • Data

yt = xt

Coefficient/Data State

βt + et Transition equation

  • βt = µt + Fβt−1 + vt

We assume

  • et ∼ i.i.d.N(0, R)
  • vt ∼ i.i.d.N(0, Q)
  • ∀t, s E(etv′

s) = 0

where R and Q are variance-covariance matrices

slide-7
SLIDE 7

Centre for Central Banking Studies Modelling and Forecasting 3

State space models

Observation equation

  • Data

yt = xt

Coefficient/Data State

βt + et Transition equation

  • βt = µt + Fβt−1 + vt

We assume

  • et ∼ i.i.d.N(0, R)
  • vt ∼ i.i.d.N(0, Q)
  • ∀t, s E(etv′

s) = 0

where R and Q are variance-covariance matrices

slide-8
SLIDE 8

Centre for Central Banking Studies Modelling and Forecasting 3

State space models

Observation equation

  • Data

yt = xt

Coefficient/Data State

βt + et Transition equation

  • βt = µt + Fβt−1 + vt

We assume

  • et ∼ i.i.d.N(0, R)
  • vt ∼ i.i.d.N(0, Q)
  • ∀t, s E(etv′

s) = 0

where R and Q are variance-covariance matrices

slide-9
SLIDE 9

Centre for Central Banking Studies Modelling and Forecasting 3

State space models

Observation equation

  • Data

yt = xt

Coefficient/Data State

βt + et Transition equation

  • βt = µt + Fβt−1 + vt

We assume

  • et ∼ i.i.d.N(0, R)
  • vt ∼ i.i.d.N(0, Q)
  • ∀t, s E(etv′

s) = 0

where R and Q are variance-covariance matrices

slide-10
SLIDE 10

Centre for Central Banking Studies Modelling and Forecasting 3

State space models

Observation equation

  • Data

yt = xt

Coefficient/Data State

βt + et Transition equation

  • βt = µt + Fβt−1 + vt

We assume

  • et ∼ i.i.d.N(0, R)
  • vt ∼ i.i.d.N(0, Q)
  • ∀t, s E(etv′

s) = 0

where R and Q are variance-covariance matrices

slide-11
SLIDE 11

Centre for Central Banking Studies Modelling and Forecasting 3

State space models

Observation equation

  • Data

yt = xt

Coefficient/Data State

βt + et Transition equation

  • βt = µt + Fβt−1 + vt

We assume

  • et ∼ i.i.d.N(0, R)
  • vt ∼ i.i.d.N(0, Q)
  • ∀t, s E(etv′

s) = 0

where R and Q are variance-covariance matrices

slide-12
SLIDE 12

Centre for Central Banking Studies Modelling and Forecasting 4

Examples: A Time-varying parameter regression

Yt = ct + ZtBt + et, ct and Bt follow a random walk

  • How to write this in State Space form?
slide-13
SLIDE 13

Centre for Central Banking Studies Modelling and Forecasting 4

Examples: A Time-varying parameter regression

Yt = ct + ZtBt + et, ct and Bt follow a random walk

  • How to write this in State Space form?

Yt =

xt

  • 1

Zt

  • βt

ct Bt

  • + et, VAR(et) = R

βt

ct Bt

  • =

βt−1

ct−1 Bt−1

  • +

v1t v2t

  • , VAR(vt) = Q

Note: F = I and µ = 0

slide-14
SLIDE 14

Centre for Central Banking Studies Modelling and Forecasting 5

Examples: A Trend Cycle Model

Decomposing GDP into trend and cycle

  • Let Yt = Ct + τ t where
  • the cycle Ct follows an AR (2) process

Ct = c + ρ1Ct−1 + ρ2Ct−2 + v1t

  • the trend follows a random walk

τ t = τ t−1 + v2t

  • How to write this in state space form?
slide-15
SLIDE 15

Centre for Central Banking Studies Modelling and Forecasting 5

Examples: A Trend Cycle Model

Decomposing GDP into trend and cycle

  • Let Yt = Ct + τ t where
  • the cycle Ct follows an AR (2) process

Ct = c + ρ1Ct−1 + ρ2Ct−2 + v1t

  • the trend follows a random walk

τ t = τ t−1 + v2t

  • How to write this in state space form?
slide-16
SLIDE 16

Centre for Central Banking Studies Modelling and Forecasting 5

Examples: A Trend Cycle Model

Decomposing GDP into trend and cycle

  • Let Yt = Ct + τ t where
  • the cycle Ct follows an AR (2) process

Ct = c + ρ1Ct−1 + ρ2Ct−2 + v1t

  • the trend follows a random walk

τ t = τ t−1 + v2t

  • How to write this in state space form?
slide-17
SLIDE 17

Centre for Central Banking Studies Modelling and Forecasting 5

Examples: A Trend Cycle Model

Decomposing GDP into trend and cycle

  • Let Yt = Ct + τ t where
  • the cycle Ct follows an AR (2) process

Ct = c + ρ1Ct−1 + ρ2Ct−2 + v1t

  • the trend follows a random walk

τ t = τ t−1 + v2t

  • How to write this in state space form?
slide-18
SLIDE 18

Centre for Central Banking Studies Modelling and Forecasting 5

Examples: A Trend Cycle Model

Decomposing GDP into trend and cycle

  • Let Yt = Ct + τ t where
  • the cycle Ct follows an AR (2) process

Ct = c + ρ1Ct−1 + ρ2Ct−2 + v1t

  • the trend follows a random walk

τ t = τ t−1 + v2t

  • How to write this in state space form?

Yt =

x

  • 1

1

  • βt

  Ct τ t Ct−1  ; R ≡ 0

βt

  Ct τ t Ct−1   =

µ

  c   +

F

  ρ1 ρ2 1 1  

βt−1

  Ct−1 τ t−1 Ct−2   +   v1t v2t  

slide-19
SLIDE 19

Centre for Central Banking Studies Modelling and Forecasting 6

Examples: A Dynamic factor model

A panel of series Yit has a common component Yit = BiFt + eit where Ft = c + ρ1Ft−1+ ρ2Ft−2 + vt

  • How to write this in state space form?
slide-20
SLIDE 20

Centre for Central Banking Studies Modelling and Forecasting 6

Examples: A Dynamic factor model

A panel of series Yit has a common component Yit = BiFt + eit where Ft = c + ρ1Ft−1+ ρ2Ft−2 + vt

  • How to write this in state space form?

yt

    Y1t Y2t . YNt     =

x

    B1 B1 . . BN    

βt

  • Ft

Ft−1

  • +

    e1t e2t . eNt    

βt

  • Ft

Ft−1

  • =

µ

c

  • +

F

ρ1 ρ2 1

  • βt−1

Ft−1 Ft−2

  • +

v1t v2t

slide-21
SLIDE 21

Centre for Central Banking Studies Modelling and Forecasting 7

Examples: Conditional Forecasting

  • Imagine you’ve just estimated the following VAR

GDPt it

  • βt

= c1 c2

  • µ

+ B1 B2 B3 B4

  • F

GDPt−1 it−1

  • βt−1

+ v1t v2t

  • vt

where it denotes the nominal interest rate. You could use the state-space toolkit to forecast GDP conditional on any path of interest rates icf,t+1, , . . . , icf,t+n

  • To do that take µ and F from the VAR and set-up
  • icf,t+s
  • ys

=

  • 1
  • x

GDPt+s it+s

  • βs

GDPt+s it+s

  • βs

= c1 c2

  • µ

+ B1 B2 B3 B4

  • F

GDPt+s−1 it+s−1

  • βs−1

+ v1t+s v2t+s

  • vs
slide-22
SLIDE 22

Centre for Central Banking Studies Modelling and Forecasting 7

Examples: Conditional Forecasting

  • Imagine you’ve just estimated the following VAR

GDPt it

  • βt

= c1 c2

  • µ

+ B1 B2 B3 B4

  • F

GDPt−1 it−1

  • βt−1

+ v1t v2t

  • vt

where it denotes the nominal interest rate. You could use the state-space toolkit to forecast GDP conditional on any path of interest rates icf,t+1, , . . . , icf,t+n

  • To do that take µ and F from the VAR and set-up
  • icf,t+s
  • ys

=

  • 1
  • x

GDPt+s it+s

  • βs

GDPt+s it+s

  • βs

= c1 c2

  • µ

+ B1 B2 B3 B4

  • F

GDPt+s−1 it+s−1

  • βs−1

+ v1t+s v2t+s

  • vs
slide-23
SLIDE 23

Centre for Central Banking Studies Modelling and Forecasting 8

Examples: Interpolation of data

  • Suppose we have quarterly GDP and we want to estimate

a monthly series ˆ Yt using information in monthly data Zt. We can treat monthly GDP numbers as unobserved states!

  • Specifically, we could assume

ˆ Yt = θ ˆ Yt−1 + DZt + ut, ut = ρut−1 + gt, VAR(g) = σ2 and define y as           GDP3 GDP6 .           with x given by           1 1 1 1 1 1 . . . .           where the unobserved state βt =

  • ˆ

Yt, ˆ Yt−1, ˆ Yt−2, ut ′ .

slide-24
SLIDE 24

Centre for Central Banking Studies Modelling and Forecasting 8

Examples: Interpolation of data

  • Suppose we have quarterly GDP and we want to estimate

a monthly series ˆ Yt using information in monthly data Zt. We can treat monthly GDP numbers as unobserved states!

  • Specifically, we could assume

ˆ Yt = θ ˆ Yt−1 + DZt + ut, ut = ρut−1 + gt, VAR(g) = σ2 and define y as           GDP3 GDP6 .           with x given by           1 1 1 1 1 1 . . . .           where the unobserved state βt =

  • ˆ

Yt, ˆ Yt−1, ˆ Yt−2, ut ′ .

slide-25
SLIDE 25

Centre for Central Banking Studies Modelling and Forecasting 9

Examples: Interpolation of data

The transition equation would then be given by      ˆ Yt ˆ Yt−1 ˆ Yt−2 ut     

βt

=     DZt    

µt

+     θ ρ 1 1 ρ    

F

     ˆ Yt−1 ˆ Yt−2 ˆ Yt−3 ut−1     

βt−1

+     gt gt     with Q =     σ2 σ2    

slide-26
SLIDE 26

Centre for Central Banking Studies Modelling and Forecasting 10

Estimation Aims

  • Observation equation yt = xtβt + et, VAR(e) = R
  • Transition equation βt = µt + Fβt−1 + vt, VAR(v) = Q
  • Parameters of the state space and the state variables are

unknown

slide-27
SLIDE 27

Centre for Central Banking Studies Modelling and Forecasting 10

Estimation Aims

  • Observation equation yt = xtβt + et, VAR(e) = R
  • Transition equation βt = µt + Fβt−1 + vt, VAR(v) = Q
  • Parameters of the state space and the state variables are

unknown

slide-28
SLIDE 28

Centre for Central Banking Studies Modelling and Forecasting 10

Estimation Aims

  • Observation equation yt = xtβt + et, VAR(e) = R
  • Transition equation βt = µt + Fβt−1 + vt, VAR(v) = Q
  • Parameters of the state space and the state variables are

unknown

slide-29
SLIDE 29

Centre for Central Banking Studies Modelling and Forecasting 11

Estimating the states via the Kalman filter

Consider the state space formulation yt = xtβt + et, et ∼ N(0, R) βt = µ + Fβt−1 + vt, vt ∼ N(0, Q) Notation: βt\t inference on βt given information up to time t Notation: Pt\t covariance of βt given information up to time t

  • Assume for the moment that R, Q, µ, F are known
slide-30
SLIDE 30

Centre for Central Banking Studies Modelling and Forecasting 12

The Kalman filter (Overview)

Starting Values (time 0) Predict States (time 1...onwards) Calculate Prediction Error Update States

t\t1 yt x tt\t1 ft\t1 x tPt\t1x t

R

K Pt\t1x t

ft\t1 1

t\t t\t1 Kt\t1 Pt\t Pt\t1 Kx tPt\t1

  • t\

t 1 F t1 \t

  • 1

P t\t 1 FP

t 1 \t 1F Q

0\0,P0\0

repeat for t = 1....T

slide-31
SLIDE 31

Centre for Central Banking Studies Modelling and Forecasting 13

The Prediction equations of the Kalman filter

  • First equation βt\t−1 = µ + Fβt−1\t−1. This is simply the

expected value of the transition equation E

  • µ + Fβt−1 + vt
  • Second equation Pt\t−1 = FPt−1\t−1F ′ + Q. Can be

derived as VAR

  • µ + Fβt−1 + vt
  • Third equation of the Kalman filter just compares the
  • utcome to the prediction: ηt\t−1 = yt − xtβt\t−1
  • Fourth equation of the Kalman filter: ft\t−1 = xtPt\t−1x′

t + R

Can be derived as E([xtβt + vt] − xtβt\t−1)2 = E(xt

  • βt − βt\t−1

2 x′

t + vtv′ t )

slide-32
SLIDE 32

Centre for Central Banking Studies Modelling and Forecasting 13

The Prediction equations of the Kalman filter

  • First equation βt\t−1 = µ + Fβt−1\t−1. This is simply the

expected value of the transition equation E

  • µ + Fβt−1 + vt
  • Second equation Pt\t−1 = FPt−1\t−1F ′ + Q. Can be

derived as VAR

  • µ + Fβt−1 + vt
  • Third equation of the Kalman filter just compares the
  • utcome to the prediction: ηt\t−1 = yt − xtβt\t−1
  • Fourth equation of the Kalman filter: ft\t−1 = xtPt\t−1x′

t + R

Can be derived as E([xtβt + vt] − xtβt\t−1)2 = E(xt

  • βt − βt\t−1

2 x′

t + vtv′ t )

slide-33
SLIDE 33

Centre for Central Banking Studies Modelling and Forecasting 13

The Prediction equations of the Kalman filter

  • First equation βt\t−1 = µ + Fβt−1\t−1. This is simply the

expected value of the transition equation E

  • µ + Fβt−1 + vt
  • Second equation Pt\t−1 = FPt−1\t−1F ′ + Q. Can be

derived as VAR

  • µ + Fβt−1 + vt
  • Third equation of the Kalman filter just compares the
  • utcome to the prediction: ηt\t−1 = yt − xtβt\t−1
  • Fourth equation of the Kalman filter: ft\t−1 = xtPt\t−1x′

t + R

Can be derived as E([xtβt + vt] − xtβt\t−1)2 = E(xt

  • βt − βt\t−1

2 x′

t + vtv′ t )

slide-34
SLIDE 34

Centre for Central Banking Studies Modelling and Forecasting 13

The Prediction equations of the Kalman filter

  • First equation βt\t−1 = µ + Fβt−1\t−1. This is simply the

expected value of the transition equation E

  • µ + Fβt−1 + vt
  • Second equation Pt\t−1 = FPt−1\t−1F ′ + Q. Can be

derived as VAR

  • µ + Fβt−1 + vt
  • Third equation of the Kalman filter just compares the
  • utcome to the prediction: ηt\t−1 = yt − xtβt\t−1
  • Fourth equation of the Kalman filter: ft\t−1 = xtPt\t−1x′

t + R

Can be derived as E([xtβt + vt] − xtβt\t−1)2 = E(xt

  • βt − βt\t−1

2 x′

t + vtv′ t )

slide-35
SLIDE 35

Centre for Central Banking Studies Modelling and Forecasting 14

The Updating equations of the Kalman filter

  • Fifth equation: βt\t = βt\t−1 + Kηt\t−1 where

K = Pt\t−1x′

tf −1 t\t−1

  • Updates old estimate βt\t−1 with information contained in

ηt\t−1

  • The Kalman gain K is weight given to new information
  • The prediction error contains information that is new

relative to the past data

slide-36
SLIDE 36

Centre for Central Banking Studies Modelling and Forecasting 14

The Updating equations of the Kalman filter

  • Fifth equation: βt\t = βt\t−1 + Kηt\t−1 where

K = Pt\t−1x′

tf −1 t\t−1

  • Updates old estimate βt\t−1 with information contained in

ηt\t−1

  • The Kalman gain K is weight given to new information
  • The prediction error contains information that is new

relative to the past data

slide-37
SLIDE 37

Centre for Central Banking Studies Modelling and Forecasting 14

The Updating equations of the Kalman filter

  • Fifth equation: βt\t = βt\t−1 + Kηt\t−1 where

K = Pt\t−1x′

tf −1 t\t−1

  • Updates old estimate βt\t−1 with information contained in

ηt\t−1

  • The Kalman gain K is weight given to new information
  • The prediction error contains information that is new

relative to the past data

slide-38
SLIDE 38

Centre for Central Banking Studies Modelling and Forecasting 14

The Updating equations of the Kalman filter

  • Fifth equation: βt\t = βt\t−1 + Kηt\t−1 where

K = Pt\t−1x′

tf −1 t\t−1

  • Updates old estimate βt\t−1 with information contained in

ηt\t−1

  • The Kalman gain K is weight given to new information
  • The prediction error contains information that is new

relative to the past data

slide-39
SLIDE 39

Centre for Central Banking Studies Modelling and Forecasting 15

The Updating equations of the Kalman filter

  • The Kalman gain in a univariate setting is given by

K = 1 xt Pt\t−1x2

t [due to uncertainty about state]

Pt\t−1x2

t + R [due to uncertainty about shock]

  • Note that K increases as Pt\t−1x2

t rises and more weight is

placed on new information in ηt\t−1

  • K falls as R increases and the shock is less informative
slide-40
SLIDE 40

Centre for Central Banking Studies Modelling and Forecasting 15

The Updating equations of the Kalman filter

  • The Kalman gain in a univariate setting is given by

K = 1 xt Pt\t−1x2

t [due to uncertainty about state]

Pt\t−1x2

t + R [due to uncertainty about shock]

  • Note that K increases as Pt\t−1x2

t rises and more weight is

placed on new information in ηt\t−1

  • K falls as R increases and the shock is less informative
slide-41
SLIDE 41

Centre for Central Banking Studies Modelling and Forecasting 15

The Updating equations of the Kalman filter

  • The Kalman gain in a univariate setting is given by

K = 1 xt Pt\t−1x2

t [due to uncertainty about state]

Pt\t−1x2

t + R [due to uncertainty about shock]

  • Note that K increases as Pt\t−1x2

t rises and more weight is

placed on new information in ηt\t−1

  • K falls as R increases and the shock is less informative
slide-42
SLIDE 42

Centre for Central Banking Studies Modelling and Forecasting 16

The initial values

  • For a stationary transition equation

β0\0 = (I − F)−1 µ P0\0 = (I − F ⊗ F)−1 vec (Q)

  • For the non-stationary case

β0\0 = arbitrary P0\0 = large number

slide-43
SLIDE 43

Centre for Central Banking Studies Modelling and Forecasting 16

The initial values

  • For a stationary transition equation

β0\0 = (I − F)−1 µ P0\0 = (I − F ⊗ F)−1 vec (Q)

  • For the non-stationary case

β0\0 = arbitrary P0\0 = large number

slide-44
SLIDE 44

Centre for Central Banking Studies Modelling and Forecasting 17

Kalman Smoothing

  • The Kalman filter provides estimates of the state given

current information

  • One may be interested in estimating the state vector at

date t based on information contained in the entire data set

  • Kalman smoothing updates βt\t for this information, it

calculates E

  • βt\βt+1, yt
  • for each t
slide-45
SLIDE 45

Centre for Central Banking Studies Modelling and Forecasting 17

Kalman Smoothing

  • The Kalman filter provides estimates of the state given

current information

  • One may be interested in estimating the state vector at

date t based on information contained in the entire data set

  • Kalman smoothing updates βt\t for this information, it

calculates E

  • βt\βt+1, yt
  • for each t
slide-46
SLIDE 46

Centre for Central Banking Studies Modelling and Forecasting 17

Kalman Smoothing

  • The Kalman filter provides estimates of the state given

current information

  • One may be interested in estimating the state vector at

date t based on information contained in the entire data set

  • Kalman smoothing updates βt\t for this information, it

calculates E

  • βt\βt+1, yt
  • for each t
slide-47
SLIDE 47

Centre for Central Banking Studies Modelling and Forecasting 18

Kalman Smoothing

  • First run the Kalman filter and save βt+1\t , βt\t , Pt+1/t, Pt/t

Starting values (time T) For T=t‐1,...1 Update states

T/T,PT/T t\T  t\t  Pt\tF′Pt1\t

−1 t1\T − Ft\t − 

Pt\T  Pt\t  Pt\tF′Pt1\t

−1 Pt1\T − Pt1\tPt1\t −1′ FPt\t ′

slide-48
SLIDE 48

Centre for Central Banking Studies Modelling and Forecasting 19

Kalman Smoothing

Starting values (time T) For T=t‐1,...1 Update states

T/T,PT/T t\T  t\t  Pt\tF′Pt1\t

−1 t1\T − Ft\t − 

Pt\T  Pt\t  Pt\tF′Pt1\t

−1 Pt1\T − Pt1\tPt1\t −1′ FPt\t ′

Kalman filtered state gain Prediction error

  • Knowledge of yt+j, xt+j redundant as this is already

incorporated in βt+1

slide-49
SLIDE 49

Centre for Central Banking Studies Modelling and Forecasting 20

Example of filtering and smoothing

Consider the following Time-varying regression for UK inflation πt = ct + btπt−1 + εt, VAR (εt) = R = 0.6 ct bt

  • βt

=

  • µ

+ 1 1

  • F

ct−1 bt−1

  • βt−1

+ v1t v2t

  • ,

VAR v1t v2t

  • =

Q = 0.006 0.001

slide-50
SLIDE 50

Centre for Central Banking Studies Modelling and Forecasting 21

Example of filtering and smoothing

0.2 0.4 0.6 0.8 1.0 1970 1975 1980 1985 1990 1995 2000 2005

AR Coefficient Filtered

0.0 0.4 0.8 1.2 1.6 2.0 1970 1975 1980 1985 1990 1995 2000 2005

Constant Filtered

.2 .3 .4 .5 .6 .7 1970 1975 1980 1985 1990 1995 2000 2005

AR coefficient Smoothed

0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1970 1975 1980 1985 1990 1995 2000 2005

Constant Smoothed

slide-51
SLIDE 51

Centre for Central Banking Studies Modelling and Forecasting 22

Maximum Likelihood estimation

  • R, Q, µ and F are generally not known but need to be

estimated

  • The Kalman filter provides us with an estimate of the

likelihood function of the model

  • Recall

yt = xβt + et, VAR(e) = R βt = µ + Fβt−1 + vt, VAR(v) = Q

  • Assuming normal error terms →

yt\xt ∼ N

  • xβt, xPt\t−1x′ + R
  • The likelihood function for each observation is

(2π)−n/2 xPt\t−1x′ + R

  • −0.5

exp

  • −0.5 (yt − xβt)′

xPt\t−1x′ + R −1 (yt − xβt)

  • r (2π)−n/2

ft\t−1

  • −0.5 exp
  • −0.5η′

t\t−1

  • ft\t−1

−1 ηt\t−1

slide-52
SLIDE 52

Centre for Central Banking Studies Modelling and Forecasting 22

Maximum Likelihood estimation

  • R, Q, µ and F are generally not known but need to be

estimated

  • The Kalman filter provides us with an estimate of the

likelihood function of the model

  • Recall

yt = xβt + et, VAR(e) = R βt = µ + Fβt−1 + vt, VAR(v) = Q

  • Assuming normal error terms →

yt\xt ∼ N

  • xβt, xPt\t−1x′ + R
  • The likelihood function for each observation is

(2π)−n/2 xPt\t−1x′ + R

  • −0.5

exp

  • −0.5 (yt − xβt)′

xPt\t−1x′ + R −1 (yt − xβt)

  • r (2π)−n/2

ft\t−1

  • −0.5 exp
  • −0.5η′

t\t−1

  • ft\t−1

−1 ηt\t−1

slide-53
SLIDE 53

Centre for Central Banking Studies Modelling and Forecasting 22

Maximum Likelihood estimation

  • R, Q, µ and F are generally not known but need to be

estimated

  • The Kalman filter provides us with an estimate of the

likelihood function of the model

  • Recall

yt = xβt + et, VAR(e) = R βt = µ + Fβt−1 + vt, VAR(v) = Q

  • Assuming normal error terms →

yt\xt ∼ N

  • xβt, xPt\t−1x′ + R
  • The likelihood function for each observation is

(2π)−n/2 xPt\t−1x′ + R

  • −0.5

exp

  • −0.5 (yt − xβt)′

xPt\t−1x′ + R −1 (yt − xβt)

  • r (2π)−n/2

ft\t−1

  • −0.5 exp
  • −0.5η′

t\t−1

  • ft\t−1

−1 ηt\t−1

slide-54
SLIDE 54

Centre for Central Banking Studies Modelling and Forecasting 22

Maximum Likelihood estimation

  • R, Q, µ and F are generally not known but need to be

estimated

  • The Kalman filter provides us with an estimate of the

likelihood function of the model

  • Recall

yt = xβt + et, VAR(e) = R βt = µ + Fβt−1 + vt, VAR(v) = Q

  • Assuming normal error terms →

yt\xt ∼ N

  • xβt, xPt\t−1x′ + R
  • The likelihood function for each observation is

(2π)−n/2 xPt\t−1x′ + R

  • −0.5

exp

  • −0.5 (yt − xβt)′

xPt\t−1x′ + R −1 (yt − xβt)

  • r (2π)−n/2

ft\t−1

  • −0.5 exp
  • −0.5η′

t\t−1

  • ft\t−1

−1 ηt\t−1

slide-55
SLIDE 55

Centre for Central Banking Studies Modelling and Forecasting 22

Maximum Likelihood estimation

  • R, Q, µ and F are generally not known but need to be

estimated

  • The Kalman filter provides us with an estimate of the

likelihood function of the model

  • Recall

yt = xβt + et, VAR(e) = R βt = µ + Fβt−1 + vt, VAR(v) = Q

  • Assuming normal error terms →

yt\xt ∼ N

  • xβt, xPt\t−1x′ + R
  • The likelihood function for each observation is

(2π)−n/2 xPt\t−1x′ + R

  • −0.5

exp

  • −0.5 (yt − xβt)′

xPt\t−1x′ + R −1 (yt − xβt)

  • r (2π)−n/2

ft\t−1

  • −0.5 exp
  • −0.5η′

t\t−1

  • ft\t−1

−1 ηt\t−1

slide-56
SLIDE 56

Centre for Central Banking Studies Modelling and Forecasting 23

Maximum Likelihood estimation

Starting Values (time 0) Predict States (time 1...onwards) Calculate Prediction Error Update States Calculate Likelihood

t\t1 yt x tt\t1 ft\t1 x tPt\t1x t

R

K Pt\t1x t

ft\t1 1

t\t t\t1 Kt\t1 Pt\t Pt\t1 Kx tPt\t1 Lt 2n/2|ft\t1 |0.5 exp 0.5t\t1

  • ft\t1 1t\t1
  • t\t

1 F

  • t

1 \t 1

P t\t 1 FP

t 1 \ t 1 F Q

0\0,P0\0

  • maximise T

t=1 Lt wrt R, Q, µ, F, A

slide-57
SLIDE 57

Centre for Central Banking Studies Modelling and Forecasting 24

Further Reading

  • Hamilton, J.D. (1994). Time series analysis. Princeton:

Princeton University Press. [Chapter 13]

  • Kim, C.-J. and C. R. Nelson (1999). State-space models

with regime switching. Cambridge, Massachusetts: MIT

  • Press. [Chapter 3]
slide-58
SLIDE 58

Centre for Central Banking Studies Modelling and Forecasting 24

Further Reading

  • Hamilton, J.D. (1994). Time series analysis. Princeton:

Princeton University Press. [Chapter 13]

  • Kim, C.-J. and C. R. Nelson (1999). State-space models

with regime switching. Cambridge, Massachusetts: MIT

  • Press. [Chapter 3]