+ All Categories
Home > Documents > Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of...

Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of...

Date post: 11-Jul-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
67
Herv´ e Le Bihan Banque de France Direction des Etudes Mon´ etaires et Financi` eres [email protected] Applied Macroeconometrics Estimation of rational expectations and DSGE models Slides for Lecture 6 ENSAE 2018/2019 1 / 67
Transcript
Page 1: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Herve Le Bihan

Banque de France

Direction des Etudes Monetaires et Financieres

[email protected]

Applied Macroeconometrics

Estimation of rational expectations and DSGE modelsSlides for Lecture 6

ENSAE 2018/2019

1 / 67

Page 2: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Plan of this lecture

1. The Maximum Likelihood approach

2. The Kalman Filter

3. Bayesian approach

2 / 67

Page 3: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Estimation by maximum likelihood

• Structural form of the DSGE (or rational expectation) model

AEtYt+1 + BYt + CYt−1 = εt

• Yt vector of data. Let θ be the parameter set built stacking elementsof the A,B,C matrices

• Use a numerical resolution procedure (those in Lecture # 4 of thecourse), to obtain the reduced form of the model :

Yt = M(θ)Yt−1 + D(θ)εt

• Recursive computation of the residuals : εt = h(θ,Yt ,Yt−1)for t = 1, ...,T

3 / 67

Page 4: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Estimation by Maximum Likelihood

• Independence assumption: εt i.i.d.

• Normality assumption εt → N(0,Ω)Ω Covariance matrix of εtUsually Ω diagonal, as matrix A captures contemporaneous correlations.

• Likelihood:

L(θ) = (2π)−nT2 |Ω|−

T2 exp

[−1

2

T∑t=1

ε′

tΩ−1εt

]

For a given θ : solve model, recursively compute residuals and compute Ω→ Numerical maximization of lnL(θ)Note : if shocks are non Gaussian, estimator is ”quasi-ML” and remainsa consistent estimator

4 / 67

Page 5: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Properties of the ML estimator

• Normality

√T (θML − θ)→ N(0, I (θ)−1)

where I (θ) is the information matrix I = E ((∂lnL(θ)/∂θ)′(∂lnL(θ)/∂θ))

• ”Delta method” → distribution of f (θ)where f (.) is differentiable continuous function of the parametersUse to compute confidence intervals for functions of the parameters

• Specification tests : normality, autocorrelation of residuals

• LR (Likelihood Ratio) test

Let θ be the constrained estimator, under m constraints

LR = 2(ln L(θ)− ln L(θ))→ χ2(m)

5 / 67

Page 6: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

The case of unobservables variablesEstimation with the Kalman filter

• Let αt be the state variables of the modeland Xt the observed variables

• Example of unobserved variable αt : potential productivity (or output).Unobserved variable can also handle autocorrelated shocks, egut = ρut−1 + εt , then ut belongs to vector αt .Then observed variables Xt (such as output growth, inflation, etc.) arerelated to unobserved ones αt through behavioural or accountingequations.

6 / 67

Page 7: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

• Reduced form of the model

State equation

αt = M(θ)αt−1 + Dεt

Measurement equation

Xt = H(θ)′αt + ηt

where θ is the set of parameters of interestεt : “structural” shocks, follow a gaussian distributionηt : measurement errors also following a gaussian distribution.

Notes: In some cases measurement errors are not needed.

In the following we note M(θ) = M to alleviate notationsand Q = DΣD ′ = DE (εtε

′t)D′

7 / 67

Page 8: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Kalman filter: prediction and updating formulas

Case without measurement errors: ηt = 0Predictions equation:

αt|t−1 = Mαt−1|t−1

Pt|t−1 = E (αt − αt|t−1)(αt − αt|t−1)′

Pt|t−1 = MPt−1|t−1M′ + Q

Updating equation:αt|t = αt|t−1 + Pt|t−1HΩ−1

t|t−1(Xt − Xt|t−1)

Pt|t = Pt|t−1 − Pt|t−1HΩ−1t|t−1H

′(Xt − Xt|t−1)

whereXt|t−1 = H ′αt|t−1

Ωt|t−1 = H ′Pt|t−1H = E (Xt − Xt|t−1)(Xt − Xt|t−1)′

Ωt|t−1 prediction errors covariance matrix

Updating formula derived from optimal projection formula of αt|t ontoαt|t−1 and Xt − Xt|t−1

8 / 67

Page 9: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Likelihood (case without measurement errors)

• Recursive computation• A date t:

L(Xt |θ) = (2π)−n2

∣∣Ωt|t−1

∣∣− 12 exp

[−1

2(Xt − Xt|t−1)′Ω−1

t|t−1(Xt − Xt|t−1)

]• Log-likelihood:

lnL(X |θ) =T∑t=1

lnL(Xt |θ)

• Initialisation of the filterα1|0 = E (αt) = 0 (with centered data)P1|0 solution of P1|0 = MP1|0M

′ + QAlternative set P1|0 a symetric matrix with ”large” entries.

9 / 67

Page 10: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Extensions

• The model with measurement errors ηt .Measurement errors are introduced in some in DSGE models for twotypes of reasons:→ Variables are actually not unobservable→ Solving the “stochastic singularity” problem.i.e. the case when the number of structural shocks εt is smaller than thenumber of observed variables.

• Entails a modification in the covariance matrix of the updating equation

Ωt|t−1 = H ′Pt|t−1H + Ση

Ση = Eηtη′t variance of measurement errors

10 / 67

Page 11: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

• Kalman smoother

• A (possible) output of the Kalman filter: Estimate of smoothedvariables αt|T .Provides the best ex-post estimate of unobserved variables.

• Initialized with αT |T

• Backward Recursion

αt|T = αt|t + Jt(αt+1|T − αt+1|t)

where Jt = Pt|tM′P−1

t+1|t

• See Hamilton, (1994), De Jong and Dave, (2007, Chap. 4)

11 / 67

Page 12: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Examples of application of ML estimator• Term structure of interest rates : Sargent (1979)

• New Phillips curve : Furher (1997), Linde (2002)

• Inventories : Fuhrer, Moore, Schuh (1995)

• Central Bank Reaction Functions : Jondeau, Le Bihan, Galles (2004)

• ”New Keynesian” DSGE Model : Ireland (2004), Ireland (2011)

In practice as soon as the model is of moderate size (say more than 3equations) important problems of empirical identification arise

12 / 67

Page 13: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Illustration: A New Keynesian perspective on the Great Recession

P.N. Ireland, Journal of Money, Credit and Banking, 2011, 43(1), 31–54Estimation of a ”New Keynesian” model of the USStudies the contribution of various schocks to the great recession

13 / 67

Page 14: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

ModelNew IS curve, with “habit formation”

λt = Et λt+1 + (rt − Etπt+1)

Marginal Utility of consumption

(z−βγ)(z−γ)λt = zγyt−1−(z2+βγ2)yt+βzγEt yt+1+(z−βγρa)(z−γ)at−γzzt

Hybrid New Keynesian Phillips Curve

(1 + αβ)πt = απt−1 + βEt πt+1 − ψλt + ψat + et

Monetary Policy Reaction Function

rt − rt−1 = ρππt + ρg gt + εrt

14 / 67

Page 15: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Shocksat preference shocket supply shock (cost-push shock)zt technology shock (random walk)εrt monetary shock ( i.i.d.)Process for the shocks:

at = ρaat−1 + εat

et = ρe et−1 + εet

zt = εzt

15 / 67

Page 16: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Model variables:yt : output corrected from technology trendObserved output growth gt

gt = yt − yt−1 + zt

where zt is the deviation of Zt/Zt−1

Output gap : deviation from the ”efficient” level of output(ie welfare-maximizing output ≡ output that would be observed withoutprice distortions )

xt = yt − qt

The level of efficient (no frictions) output depends on zt and at , pnot onet

(z2 + βγ2)qt = γzqt−1 + βγzEt qt+1 + βγ(z − γ)(1− ρa)at − γzzt

16 / 67

Page 17: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

VariablesObserved Variables (Centered)

gt Per capita GDP growthπt inflation – GDP deflatorrt short-run interest rate ( 3 month T-bill)

Unobserved Variablesyt log-deviation of Yt/Zt

xt output gapPersistent shocks

at preference shocket cost-push shockzt technology shock

17 / 67

Page 18: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

EstimationUS quarterly data 1983:1 2009:4

Estimation: ML with Kalman FilterVector of variables in the measurement equations: (gt , πt , rt).

Constrained (calibrated) parameters:β = 0.9987long term inflation and growth rate set equal to historical averagesψ = 0.1 (consistence with a “Calvo” price fixity duration of 3.8

quarters)

18 / 67

Page 19: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Results

Price-setting is mainly ”forward-looking” Backward-looking componentalso sizeable in consumption (γ = 0.39) Estimated shock persistence israther large

19 / 67

Page 20: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

IRFs: responses have the expected dynamics

20 / 67

Page 21: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

ResultsForecast error variance decomposition

21 / 67

Page 22: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Results – contributions of shocks to the Great Recession

- Dashed lines : observed GDP- Plain line : contrefactual (only one shock is “activated”)

22 / 67

Page 23: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Results – ZLB and monetary policy shocks

Conclusions:

I role of technology and preference shocks in the great recession

I role of zero lower bound (restrictive monetary policy shocks)

I need to consider model with financial shocks23 / 67

Page 24: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

The bayesian approach

• Why a bayesian approach to DSGE models?Two types of motivations→ a ”philosophical” motivation→ a pragmatic motivation

24 / 67

Page 25: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

• The bayesian ”philosophy”:→ object/outcome of the analysis: the subjective knowledge of thedistribution of parameters by the econometrician

→ no assumption that there is an unknown ”true value” of parameters

→ the observations do influence the econometrician’s belief: distinctionbetween a priori distribution and a posteriori distribution

→ the bayesian approach do not rely on asymptotic properties

25 / 67

Page 26: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

• Bayesian approach well suited to decision-making under uncertainty• The classical approach:

(1) estimate a parameter θ, then test H0 : θ = θ0

then (2) Minimize a loss function EεtL(θ, εt) ”as if” θ was known• A bayesian approach:Minimize a loss function EθEεtL(θ, εt), which incorporates “modeluncertainty”.

26 / 67

Page 27: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

• Interest of the bayesian approach in the context of DSGE models

- Allows to incorporate a priori information on parameters (eg , fromprevious studies, micro data, etc)- Limits or suppress identification problems, that are pervasive with ML.Identification issues are particularly important for medium or large sizemodels

• References: De Jong and Dave (2007, chap 9), Canova (2007, chap.8), Adjemian and Pelgrin (Economie et Prevision, 2008)

27 / 67

Page 28: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

The posterior density

• Let YT be the data , θ the parameter set,• Notations:p(YT , θ) joint distribution of parameters and datag(θ) a priori distribution of parametersg(θ|YT ) posterior density of parameters:

• From basic conditional probability results

p(YT , θ) = g(θ|YT )f (YT )

28 / 67

Page 29: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

• Applying the Bayes rule:

g(θ|YT ) = f (YT |θ)g(θ)f (YT )

• The posterior density g(θ|YT ) is proportional to:- the data likelihood: f (YT |θ)- the prior density of parameters g(θ)

29 / 67

Page 30: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

• The data likelihood f (YT |θ), is computed as in the standard MLapproach (see previous section on this topic).

• Results of a bayesian estimation:→ Mainly: the posterior distribution of parameters. Representedgraphically.→ Computing the mode, and moments of the posterior distribution

30 / 67

Page 31: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Relationship with the classical approach

• The classical maximum likelihood estimator:Mode of the likelihood function• Bayesian “estimator”: mean or mode of the posterior density

• When sample size goes to infinity: converges towards the ML estimator.The weight of the ‘priors’ decresase relative that of the likelihood.

(• Note however: in the “pure” bayesian approach, the sample sizecannot go to infinity !)

31 / 67

Page 32: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

A simple exampleModel (DGP)

yt = θ + εt

where θ is scalar, εt → N(0, 1) i.i.d.Likelihood:

f (YT |θ) = (2π)−T2 exp

[−1

2

T∑t=1

(yt − θ)2

]

ML Estimator:

θML = y =1

T

T∑t=1

yt

32 / 67

Page 33: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Let the prior distribution be

θ → N(θ0, σ)

The density of the prior distribution

g(θ) = (1/√

2π) exp(−1

2σ(θ − θ0)2)

Posterior density g(θ|YT ) proportional to:

g(θ)f (YT |θ) = (1/√

2π) exp(−12σ (θ − θ0)2)(2π)−

T2 exp

[− 1

2

T∑t=1

(yt − θ)2

]In log: ln g(θ|YT ) ∝ − (θ−θ0)2

σ −T∑t=1

(yt − θ)2

We obtain

lng(θ|YT ) ∝ − 1( 1σ2 +T )−1

[θ − θ0/σ

2+Ty

( 1σ2 +T )

]2

33 / 67

Page 34: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Mean of parameter posterior distribution

E (θ) = (T

σ−2 + T)y + (

σ−2

σ−2 + T)θ0

A linear combination of the mean of a priori distribution and theempirical mean!

If σ2 −→∞ or T −→∞, E (θ) ≈ θML

If σ2 −→ 0 (very informative prior) or T small, E (θ) ≈ θ0

(in the latter case, the priors have the main role)

34 / 67

Page 35: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

How to choose the prior distribution?

• Subjective beliefs:- diffuse prior, when a priori there is a large uncertainty (flat priordistribution; eg uniform distribution)- vs informative prior (distribution with a spike: eg gaussian distribution)• Constraints on the support of parameters: discount rate 0 < δ < 1,positive variances, etc.• Use of previous studies or data (eg: micro data) to parametrize theprior distribution.

35 / 67

Page 36: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

• Examples of widely used prior distributions:Normal : if parameter density support is large and the a priori is”informative”

Gamma, Inverse Gamma : when support R+ (typically InverseGamma for variances),

Uniform : case of bounded parameters with a diffuse prior

Beta : case of bounded parameters with an “informative” prior

36 / 67

Page 37: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Caracterizing the posterior distribution of the parameters

• Only in very particular cases, the density has a known analytical form,from which moments can easily be derived (normal distribution,“conjugate” priors).• In general, posterior density is non standard and has a complicatedanalytical form.→ Computation of the mode of the density through a numericaloptimisation algorithm→ Moments and quantiles are computed from simulations using theposterior distributionEh(θ) approximated by 1

N

∑h(θj)

where θj are draws in the posterior distribution→ Use of (simulation) algorithms to perform draws in the posteriordistribution

37 / 67

Page 38: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

• Example of algorithms: Importance sampling, Markov Chain MonteCarlo.Rely on performing draws in known auxiliary distributions.• Gibbs sampling Algorithm :Case of two known conditional distributions f (x |y) and f (y |x) , but thejoint distribution of (x , y) is unknownInitialize x1, y0 in the support of the joint distributionSimulate xs |ys−1 and ys |xs for s = 1, ...,S .Asymptotically the sample of (xs , ys) couples follows the jointdistribution!

38 / 67

Page 39: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

The Metropolis-Hastings algorithm: overview

• Perform a very large number of simulations s = 1, ...,S . to approximatethe posterior distribution of θ (S = 100, 000 for example).

• Use an auxiliary distribution to draw “candidate parameters” (denotedparameter a), at each step s.Distribution Js(a|θ(s−1)) with density ϕExample Js N(θ(s−1), c2Σ) where Σ is the inverse of the Hessianestimated at the mode of the posterior distribution

39 / 67

Page 40: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

• At iteration s :- accept the candidate parameter with probability min(r , 1) (thenθ(s) = a)with

r =f (YT |a)

f (YT |θ(s−1))

g(a)

g(θ(s−1))

- otherwise reject candidate parameter (then θ(s) = θ(s−1))• The resulting sequence of θ(s)’s is autocorrelated, but the sample ofθ(s)’s provides an approximation to the posterior distribution g(θ|YT ).Several procedures are available to check wether the distribution hasconverged (see for instance De Jong and Dave, 2007)

40 / 67

Page 41: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Testing and evaluating models

• Strictly speaking, there is no test in the Bayesian approach (no nullhypothesis).

• One may evaluate however the posterior probability of alternativecompeting models

• Let M1 and M2 be two competing models

• Marginal data density of data for model M1 is

p(YT |M1) =

∫f (YT |θ1,M1)g(θ1|M1)dθ1

where θ1 describes the parameters of model 1.

41 / 67

Page 42: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

• Posterior odds ratio

PO1,2 =π(M1)

π(M2)∗ p(YT |M1)

p(YT |M2)

where π(M1)π(M2) is the prior ratio of probabilities

p(YT |M1)p(YT |M2) is the Bayes factor

PO1,2 allows to compare the plausibility of M1 and M2 after theresearcher has observed the data.

42 / 67

Page 43: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

• Bayesian equivalent of confidence interval : ”higher posterior density”region.Set of parameters, of smallest possible size, that covers a givenprobability mass of the posterior distribution (for instance 90% )

• Forecasting evaluation of models: predictive density

p(yt+1, ..., yt+K |YT ) =

∫θ

g(θ|YT )∏

f (yt+k |θ ,YT , yt+1, ..., yt+k−1)dθ

Doubts on the model if the predictive probability of a given sample is low.Bayesian ”p-values” can be computed.

43 / 67

Page 44: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Application to DSGE models• Computation of posterior density has to be articulated with modelsolution. Steps:For a given value of θ in the support of the prior density :- solve the model (using a resolution algorithm a la Blanchard and Kahn)- compute the sample likelihood, and the posterior densityMaximize posterior density unsing numerical routine to recover theposterior modePerform draws in the posterior density using MCMC (Monte CarloMarkov Chain) algorithms

• The bayesian approach to estimating models is implemented inDYNARE sofware

44 / 67

Page 45: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Bayesian estimation of DSGE models: some references

• Schorfheide (2000), An and Schorfheide(2007) Dejong and Dave (2007,chap. 9)• Example of application: Smets and Wouters (2003), a DSGE model ofthe euro area (see also S&W, 2005 and S&W, 2007, model for the US)

45 / 67

Page 46: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Smets et Wouters (2003) ”An Estimated Dynamic StochasticGeneral Equilibrium Model of the euro Area”, Journal of theEuropean Economic Association 1(5):1123–1175

”New Keynesian” DSGE Model of the euro area, estimated throughbayesian methods

A reference model for studying monetary policy issues. Used at ECB andvarious central banks.

46 / 67

Page 47: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Equations of linearized model

ConsumptionConsumption saving trade-off.Habit formation in preferences: utility depends on past aggregateconsumption

Linearized Euler equation:

ct = (h

1 + h)ct−1 +

1

(1 + h)Et ct+1 −

1− h

(1 + h)σc(it − Et πt+1) + aεbt

where h : parameter for weigth of habits.

47 / 67

Page 48: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Investment:Households own the capital stock and rent it to firms

Frictions:- cost of adjusting the capital stock, a function of capital rate of growthauxiliary variable: Tobin’s Q Qt : ”shadow” real price of capital stock- variable rate of utilisation of capital

48 / 67

Page 49: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Investment depends on Tobin’s Q, with some smoothing:

It =1

1 + βIt−1 +

β

1 + βEt It+1 +

φ

1 + βQt + εIt

Forward-looking determination of Tobin’s Q (present discounted value ofcapital)

Qt = −(it − Et πt+1) + β(1− τ)EtQt+1 + βrk rKt+1 + ηQt

with rKt+1 rental price of capital.Capital stock

Kt = (1− τ)Kt−1 + τ It−1

49 / 67

Page 50: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Prices and Wages :Nominal rigidities a la Calvoξp : proba. of price fixity.Degree of indexation: γpInflation - New Keynesian Phillips Curve:

πt = ωπf Et πt+1 + ωπb πt−1 +1

1 + βγp

(1− βξp)(1− ξp)

ξp[αrKt + (1− α)wt − εat ]

+ηpt

where ωπf = β/(1 + γpβ) and ωπb = γp/(1 + γpβ)

50 / 67

Page 51: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

WagesWorkers supply labour under monopolistic competitionWage rigidity is modelled similarly as price rigidityNew Keynesian Phillips Curve for Wages:

wt = ωwf Etwt+1 +ωw

b wt−1 +β

(1 + β)Et πt+1 +

1 + βγw(1 + β)

πt +γw

(1 + β)πt−1

−aw [wt − σLLt −σc

1− h(ct − hct−1)− εLt ] + ηwt

wherewt is real wage in log-deviationaw depends on β, ξw , λw

51 / 67

Page 52: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Taylor rule like monetary policy rule:

it = ρit−1 + (1− ρ)πt + rπ(πt−1 − πt) + rY (Yt − Y Pt )

+(r∆π(πt − πt−1) + r∆Y ((Yt − Y Pt )− (Yt−1 − Y P

t−1))

+ηit

where πt : persistent shock on inflation target

Labor demandLt = −wt + (1 + ψ)rKt + Kt−1

GDP (linearized ressource constraint)

Yt = (1− τky − gy )ct + τky It + gy εgt

52 / 67

Page 53: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Estimation• Quarterly Euro area data 1980:1999• ECB ”AWM” historical database• Seven observed databases : GDP, consumption , investment,employment, GDP deflator , real wage , short run interest rateVariables are detrended (linear trend) prior to estimation to inducestationarity• Use of Kalman filter to handle some unobserved variables : capitalstock , user cost of capital,...)• Bayesian Estimation

53 / 67

Page 54: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Bayesian Estimation Results

54 / 67

Page 55: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Results (continued)

55 / 67

Page 56: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Prior and posterior Distributions

56 / 67

Page 57: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

57 / 67

Page 58: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Comparing model with VAR models

58 / 67

Page 59: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Response function to (structural) shocksProductivity shocks

59 / 67

Page 60: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

(Temporary) Monetary policy shock

60 / 67

Page 61: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Forecast error variance decomposition

61 / 67

Page 62: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Smets and Wouters (2007) ”Shocks and Frictions in US BusinessCycle: A Bayesian DSGE Approach”, American Economic ReviewVol 97, 3Linde, Smets and Wouters (2016) ”Challenges for Central BankMacro Models”,

Papers Follow-up of Smets and Wouters (2003).Several extensions :i) more general specificationsii) extend to the USiii) LSW (2016) sample include the crisis and discusses challenge raisedby the Zero Lower Bound.

62 / 67

Page 63: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

SW(2007) and LSW(2016) Models very close to SW(2003)However : no pre-detrending of dataStochastic trend in the model materialized in the measurement equations

Yt =

∆lnGDPt

∆lnCONSt∆lnINVt

∆lnW realt

lnHOURSt∆lnPGDPt

FFRt

=

γγγγlπr

+

yt − yt−1

ct − ct−1

it − it−1

w realt − w real

t−1

ltπtRt

(1)

63 / 67

Page 64: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Forecast failure of DSGE during the Great Recession

Source: LSW (2016)

64 / 67

Page 65: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

LSW (2016) explore 3 extensions to SW (2003) and SW (2007) in orderto fit the crisis period:i) The zero lower bound (ZLB) on interest ratesii) Non gaussian shocks through time varying innovation varianceiii) Financial FrictionsEach of these extensions requires going beyond the standard linearGaussian framework studied in this lecture.

65 / 67

Page 66: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

Concluding remarks : Wrap-up and comparison of the approaches

The various estimation approaches: summarySorted by increasing degree of prior information requested from theeconometrician:• GMM:→ Only specify (some of) the relationships that include parameter ofinterest – and choose instrumental variables

• M-estimators:→ need to specify the full model, and to identify at least some of theshocks

• ML:→ need to specify all shock processes, and their probability distribution

• Bayesian estimation:→ need to specify in addition a prior distribution for the parameters.

All estimators are consistent (...if the model if well specified !).

66 / 67

Page 67: Applied Macroeconometrics - WordPress.com · Slides for Lecture 6 ENSAE 2018/2019 1/67. Plan of this lecture 1.The Maximum Likelihood approach 2.The Kalman Filter 3.Bayesian approach

The Bayesian approach seems currently the most popular, close toa standard• For good reasons, but also for mainly practical reasons:

I Allows to incorporate prior information

I Numerical identification and convergence easier than with ML

I Implemented in the user-friendly DYNARE software

• You should keep aware:

I The Bayesian approach requires to specify a full model

I The Bayesian approach (as simulated methods) is computationallyintensive, results may not be accurate if MCMC does not converge

I Results are potentially very sensistive to choice of prior.The Bayesian approach has a “sophisticated calibration” flavor.Be sure to carefully motivate and document your choice of priors

67 / 67


Recommended