26
Non-linear DSGE models, The Central Difference Kalman Filter, and The Mean Shifted Particle Filter Martin M. Andreasen Bank of England Conference in Stockholm Oct. 17-18 2008

Non-linear DSGE models, The Central Difference Kalman Filter, …archive.riksbank.se/Upload/Research/Conferences/State... · 2008. 10. 22. · 4.0 The Mean Shifted Particle Filter

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Non-linear DSGE models, The Central Difference Kalman Filter, …archive.riksbank.se/Upload/Research/Conferences/State... · 2008. 10. 22. · 4.0 The Mean Shifted Particle Filter

Non-linear DSGE models, The Central Difference Kalman Filter, and The Mean Shifted Particle Filter

Martin M. AndreasenBank of EnglandConference in Stockholm Oct. 17-18 2008

Page 2: Non-linear DSGE models, The Central Difference Kalman Filter, …archive.riksbank.se/Upload/Research/Conferences/State... · 2008. 10. 22. · 4.0 The Mean Shifted Particle Filter

2

Introduction

Likelihood based inference by the Kalman Filter has become a standard way of taking linearized DSGE models to the data.Fernandez-Villaverde and Rubio-Ramirez (RES, 2007) show how to do likelihood based inference for non-linear DSGE models with potentially non-Gaussian shocks.

Use the standard Particle Filter (PF): the proposal distribution is the transition distribution.An (2005), Strid (2006), Doh (2007), and An & Schorfheide (2007)

Page 3: Non-linear DSGE models, The Central Difference Kalman Filter, …archive.riksbank.se/Upload/Research/Conferences/State... · 2008. 10. 22. · 4.0 The Mean Shifted Particle Filter

3

Introduction

The standard PF: suffers from the “sample depletion” problem.In small models, the brute force solution -increase the number of particles. Disadvantage of the brute force solution:

increases the computational requirements for the standard PF even further.We show for large models (many state variables) and many particles in the stanard PF that a great deal of inaccuracy still remains in the filter.

Page 4: Non-linear DSGE models, The Central Difference Kalman Filter, …archive.riksbank.se/Upload/Research/Conferences/State... · 2008. 10. 22. · 4.0 The Mean Shifted Particle Filter

4

Introduction

Hence, faster and more precise filtering methods are needed for large DSGE models

The purpose of this paper:Developing and testing new filters in the context of large DSGE models

Page 5: Non-linear DSGE models, The Central Difference Kalman Filter, …archive.riksbank.se/Upload/Research/Conferences/State... · 2008. 10. 22. · 4.0 The Mean Shifted Particle Filter

5

Introduction

Outline for the presentation1. Present the Central Difference Kalman Filter

(CDKF) by Norgaard et al (2000) for state estimation in nonlinear and non-Gaussian state space models.

2. Introduce a new QML estimator based on the CDKF

3. Two extensions of the standard PF4. A new Particle Filter: The Mean Shifted

Particle Filter (MSPF)5. Simulations results6. Conclusion

Page 6: Non-linear DSGE models, The Central Difference Kalman Filter, …archive.riksbank.se/Upload/Research/Conferences/State... · 2008. 10. 22. · 4.0 The Mean Shifted Particle Filter

6

The state space system

( )( )( )

( ) ( ) ( ) ( )twtv

1tt

t1

tt

wRvR

xx

x

θ;wxhxθ;xhxθ;v,xgy

tt

t

tt

t

t

t

VartVart ≡≡

⎥⎦

⎤⎢⎣

⎡≡

=

==

++

+

and

,

,2

,1

,221,2

1,1

Page 7: Non-linear DSGE models, The Central Difference Kalman Filter, …archive.riksbank.se/Upload/Research/Conferences/State... · 2008. 10. 22. · 4.0 The Mean Shifted Particle Filter

7

1.0 Central Difference Kalman Filter (CDKF)

CDKF: A generalization of the standard Kalman Filter to non-linear and non-Gaussian state space models. A linear updating rule is imposed for the state estimator.The a priori state estimator and is covariance matrix

Updating

( )[ ]( ) ( )( )[ ]'1 1111

1

++++

++

−−≡+

ttttt

tt

EtE

xxxxPθ;w,xhx

xx

1tt

( )( )[ ]( ) ( ) 111

ˆ

−+

+++

+++++

++=

≡−+=

tt

Et

yyxy1t

1t1t1t

1t1t1t1t1t

PPK

θ;v,xgyyyKxx

Page 8: Non-linear DSGE models, The Central Difference Kalman Filter, …archive.riksbank.se/Upload/Research/Conferences/State... · 2008. 10. 22. · 4.0 The Mean Shifted Particle Filter

8

1.0 Central Difference Kalman Filter (CDKF)

How is the first and second moments evaluated?Use Multivariate Stirling Interpolation to calculate the first and the second moments in the CDKF up to at least an accuracy of second order.

It is a deterministic sampling approach – no derivatives are needed.Fast and robust.If all variables in the system are normal distributed, then the approximation is accurate up to third order.

Page 9: Non-linear DSGE models, The Central Difference Kalman Filter, …archive.riksbank.se/Upload/Research/Conferences/State... · 2008. 10. 22. · 4.0 The Mean Shifted Particle Filter

9

2.0 QML based on the CDKFLikelihood based inference of parameters in the state space system is not possible based on CDKFWe suggest a QML for the typical case where

Reasonable to assume

Given standard regularity assumptions, consistency and normality can be shown based on Bollerslev and Woodrigde(1992) if the first and second moments are correctly specified

( ) ( )( )( ) ( )( )tNid

tNid

wttt1t

vtttt

Rwηwθ;xhxRvvθ;xgy

0, is 0, is

+=+=

+

( )( )1, is :1 +++ tNt yy1t1t Pyyy

Page 10: Non-linear DSGE models, The Central Difference Kalman Filter, …archive.riksbank.se/Upload/Research/Conferences/State... · 2008. 10. 22. · 4.0 The Mean Shifted Particle Filter

10

2.0 QML based on the CDKF

For linearized DSGE models: First moments are accurate up to first.Second moments are accurate up to second order. The CDKF reduces to the Kalman Filter which exactly captures the first and second moments to the desired degree of precision

For DSGE models app. up to second order:First moments are accurate up to second order.Second moments are accurate up to third order.The CDKF only misses the third order terms in the second moments. These are normally small.Alternatively, if all variables in the system are taken to be app. normally distributed, then the CDKF is accurate up to third order.

Page 11: Non-linear DSGE models, The Central Difference Kalman Filter, …archive.riksbank.se/Upload/Research/Conferences/State... · 2008. 10. 22. · 4.0 The Mean Shifted Particle Filter

11

2.0 QML based on the CDKF

For DSGE models app. up to third order:First moments are accurate up to third orderSecond moments are accurate up to fourth orderIf all variables in the system are taken to be app. normally distributed, then the CDKF only misses the fourth moments in the second moments.

For DSGE models app. up to fourth or higher order:

Consistency and normally is hard to insure based on the CDKF.Particle filters are needed.

Page 12: Non-linear DSGE models, The Central Difference Kalman Filter, …archive.riksbank.se/Upload/Research/Conferences/State... · 2008. 10. 22. · 4.0 The Mean Shifted Particle Filter

12

3.0 Two extensions of the standard PF

A critical component in particle filters is the proposal distributionThe optimal proposal distribution is

The standard PF uses the “blind” proposal:

Fast to evaluate and easy to sample from.Unfortunate that no current information is used.

( ) ( )θ;y,xxy,xx 1tt1t1tt:01t ++++ = pπ

( ) ( )θ;xxθ;y,xx t1t1tt1t +++ ≈ pp

Page 13: Non-linear DSGE models, The Central Difference Kalman Filter, …archive.riksbank.se/Upload/Research/Conferences/State... · 2008. 10. 22. · 4.0 The Mean Shifted Particle Filter

13

3.0 Two extensions of the standard PF

The Extended Kalman Particle Filter by Doucet et al (2000):

Each particle is send through the Extended Kalman Filter.Gets particles to areas of higher likelihood.VERY time consuming to implement.

The Sigma Point Particle Filter by Merwe & Wan (2000):

More precise estimates of the conditional mean and variances in the proposal distribution.

( )( ) ( ) ( ) ( )( ) NitNp iEKFiEKFtt ,...,2,1for 1ˆ,ˆ ,,

11 =+≈ +++ xxi

t1t Pxy,xx

( )( ) ( ) ( ) ( )( ) NitNp iCDKFiCDKFt ,...,2,1for 1ˆ,ˆ ,,

1 =+≈ +++ xx1ti

t1t Pxy,xx

Page 14: Non-linear DSGE models, The Central Difference Kalman Filter, …archive.riksbank.se/Upload/Research/Conferences/State... · 2008. 10. 22. · 4.0 The Mean Shifted Particle Filter

14

4.0 The Mean Shifted Particle Filter (MSPF)

We suggest a third approximation of the optimal proposal distribution which is much faster to calculate

Only need ONE evaluation of the CDKF.Current information is included.We preserve all features in the previous posterior distribution.The defining feature is the mean shifting operation.

( ) ( ) ( ) ( )

tCDKF

tt

it

CDKFt

it

it Nit

xxμ

εSμxx x

ˆˆ

,...,2,1for 1ˆˆ

11

111

−≡

=+++=

++

+++

Page 15: Non-linear DSGE models, The Central Difference Kalman Filter, …archive.riksbank.se/Upload/Research/Conferences/State... · 2008. 10. 22. · 4.0 The Mean Shifted Particle Filter

15

5.0 Simulation results

Consider a standard New-Keynesian DSGE models with 5 shocks and 6 endogenous state variablesThe solution is app. up to second orderWe use five series for the experiment:

Interest rate, Inflation rate, Growth rate in consumption, Growth rate in investments, and Growth rate in GDP

We generate 100 test economies with different values of the structural parameters.

For each economy we simulate 50 data sets with T=200 and calculate RMSE

Page 16: Non-linear DSGE models, The Central Difference Kalman Filter, …archive.riksbank.se/Upload/Research/Conferences/State... · 2008. 10. 22. · 4.0 The Mean Shifted Particle Filter

16

5.0 Simulation results

Page 17: Non-linear DSGE models, The Central Difference Kalman Filter, …archive.riksbank.se/Upload/Research/Conferences/State... · 2008. 10. 22. · 4.0 The Mean Shifted Particle Filter

17

The mean correction term is seen to be estimated quite accurately. But momentarily too large or too small estimates of the covariance matrix could explain the relatively high number of filter divergences. MSPF with backup proposal distribution

( ) ( ) ( ) ( )

tCDKF

tt

itt

it

it Nit

xxμ

εSμxx w

ˆˆ

,...,2,1for 1ˆ

11

111

−≡

=+++=

++

+++

Page 18: Non-linear DSGE models, The Central Difference Kalman Filter, …archive.riksbank.se/Upload/Research/Conferences/State... · 2008. 10. 22. · 4.0 The Mean Shifted Particle Filter

18

5.0 Simulation results

Page 19: Non-linear DSGE models, The Central Difference Kalman Filter, …archive.riksbank.se/Upload/Research/Conferences/State... · 2008. 10. 22. · 4.0 The Mean Shifted Particle Filter

19

5.0 Simulation results

Surprisingly, the CDKF outperforms both particle filters. Is this result robust to having non-normal shocks driving the economy?Next, the case with Laplace distributed shocks (thicker tails than the normal distribution)

Page 20: Non-linear DSGE models, The Central Difference Kalman Filter, …archive.riksbank.se/Upload/Research/Conferences/State... · 2008. 10. 22. · 4.0 The Mean Shifted Particle Filter

20

5.0 Simulation results

Page 21: Non-linear DSGE models, The Central Difference Kalman Filter, …archive.riksbank.se/Upload/Research/Conferences/State... · 2008. 10. 22. · 4.0 The Mean Shifted Particle Filter

21

5.0 Simulation results

Still the CDKF performs better than the two particle filters.Is this also the case if we gradually increase the number of shocks from 1 to 5?

Page 22: Non-linear DSGE models, The Central Difference Kalman Filter, …archive.riksbank.se/Upload/Research/Conferences/State... · 2008. 10. 22. · 4.0 The Mean Shifted Particle Filter

22

5.0 Simulation results

Page 23: Non-linear DSGE models, The Central Difference Kalman Filter, …archive.riksbank.se/Upload/Research/Conferences/State... · 2008. 10. 22. · 4.0 The Mean Shifted Particle Filter

23

5.0 Simulation results

With 1 and 2 shocks: the particle filters are better than the CDKFWith 3 or more shocks: the CDKF is betterThe MSPF is either the best filter or very close to the best filter.

Page 24: Non-linear DSGE models, The Central Difference Kalman Filter, …archive.riksbank.se/Upload/Research/Conferences/State... · 2008. 10. 22. · 4.0 The Mean Shifted Particle Filter

24

5.0 Simulation results

The finite sample distribution of the QML estimator based on the CDKF.We consider five structural parameters to be unknown.With normal shocks driving the economy:

Page 25: Non-linear DSGE models, The Central Difference Kalman Filter, …archive.riksbank.se/Upload/Research/Conferences/State... · 2008. 10. 22. · 4.0 The Mean Shifted Particle Filter

25

5.0 Simulation results

With Laplace distributed shocks driving the economy:

Page 26: Non-linear DSGE models, The Central Difference Kalman Filter, …archive.riksbank.se/Upload/Research/Conferences/State... · 2008. 10. 22. · 4.0 The Mean Shifted Particle Filter

26

6.0 Conclusion

Tested the precision of the standard PF and the CDKF.Suggested a new QML estimator based on the CDKF.Developed the MSPF.Our mean shifted proposal distribution can also be used in relation to other extensions of the particle filter.