Implementation
Implementation
Frank Schorfheide
Department of Economics, University of Pennsylvania
Frank Schorfheide, University of Pennsylvania: Bayesian Methods 2
Bayesian Analysis
T
R
– Marginal data density p(Y ) = p(Y T |θ)p(θ)dθ
• Bayes Theorem:
T L(θ|Y T )p(θ)
p(θ|Y ) = (1)
p(Y T )
Frank Schorfheide, University of Pennsylvania: Bayesian Methods 3
Specifying Priors
• Sanity check:
Example
1
M1 : yt = IE t[yt+1] + ρyt−1 + ut, ut = ²t ∼ iid(0, σ 2). (2)
α
and
1
M2 : yt = IE t[yt+1] + ut, ut = ρut−1 + ²t ∼ iid(0, σ 2). (3)
α
1 p 2α
M1 : yt = (α − α2 − 4ρα)yt−1 + p ²t, (4)
2 2
α + α − 4ρα
1
M2 : yt = ρyt−1 + ²t . (5)
1 − ρ/α
Frank Schorfheide, University of Pennsylvania: Bayesian Methods 5
Example
• The model with the ‘backward looking’ component is distinguishable from the purely
‘forward looking’ specification only under a strong a priori restriction on the exogenous
component, namely ρ = 0.
• Although M1 and M2 will generate identical reduced form forecasts, the effect of
Notes: Para (1) and Para (2) list the means and the standard deviations for Beta, Gamma,
and Normal distributions; the upper and lower bound of the support for the Uniform distri-
2 2
bution; s and ν for the Inverse Gamma distribution, where pIG (σ|ν, s) ∝ σ −ν−1e−νs /2σ .
The effective prior is truncated at the boundary of the determinacy region.
Frank Schorfheide, University of Pennsylvania: Bayesian Methods 7
Posterior Computations
• Bayes Theorem:
L(θ|Y )p(θ)
p(θ|Y ) = R
L(θ|Y )p(θ)dθ
• Posterior moments
R
h(θ)L(θ|Y )p(θ)dθ
IE[h(θ)|Y ] = R
L(θ|Y )p(θ)dθ
• For DSGE model: use Random Walk Metropolis Algorithm, e.g., Schorfheide (2000),
2. Let Σ̃ be the inverse of the Hessian computed at the posterior mode θ̃.
4. For s = 1, . . . , nsim, draw ϑ from the proposal distribution N (θ(s−1), c2Σ̃). The jump
from θ(s−1) is accepted (θ(s) = ϑ) with probability min {1, r(θ(s−1), ϑ|Y )} and rejected
L(ϑ|Y )p(ϑ)
r(θ(s−1), ϑ|Y ) = .
L(θ(s−1)|Y )p(θ(s−1))
1
Pnsim
5. Approximate the posterior expected value of a function h(θ) by nsim s=1 h(θ(s)).
Frank Schorfheide, University of Pennsylvania: Bayesian Methods 13
2. Let Σ̃ be the inverse of the Hessian computed at the posterior mode θ̃.
3. Let q(θ) be the density of a multivariate t-distribution with mean θ̃, covariance matrix
(insert figures)
52
Notes: Output gap rule specification M1 , Data Set 1-M1 . The panels depict 200 draws
from prior and posterior distributions. Intersections of solid lines signify posterior mode
values.
53
Notes: Output gap rule specification M1 , Data Set 1-M1 . Panels (1,1) and (1,2): contours
of posterior density at the mode as function of τ and ψ2 . Panels (2,1) to (3,2): 200 draws
from four Markov chains generated by the Metropolis Algorithm. Intersections of solid lines
signify posterior mode values.
54
Notes: Output gap rule specification M1 , Data Set 1-M1 . Each line corresponds to recursive
means (as a function of the number of draws) calculated from one of the four Markov chains
generated by the Metropolis Algorithm.
55
Notes: Output gap rule specification M1 , Data Set 1-M1 . Panels depict posterior modes
(solid), recursively computed 95% bands for posterior means based on the Metropolis Algo-
rithm (dotted) and the Importance Sampler (dashed).
56
Notes: Output growth rule specification M2 , Data Set 1-M2 . Panels (1,1) and (1,2):
contours of posterior density at “low” and “high” mode as function of τ and ψ 2 . Panels
(2,1) to (3,2): 200 draws from four Markov chains generated by the Metropolis Algorithm.
Intersections of solid lines signify “low” (left panels) and “high” (right panels) posterior
mode values.
57
Notes: Output growth rule specification M2 , Data Set 1-M2 . Each line corresponds to
recursive means (as a function of the number of draws) calculated from one of the four
Markov chains generated by the Metropolis Algorithm.
Frank Schorfheide, University of Pennsylvania: Bayesian Methods 14
• Early MLE: Altug (1989), McGrattan (1994), Leeper and Sims (1994), and Kim (2000).
• Bayesian calibration: Canova (1994), DeJong, Ingram, and Whiteman (1996), and
Geweke (1999b).
• Early Bayesians: Landon-Lane (1998), DeJong, Ingram, and Whiteman (2000), Schorfheide
• Real models: DeJong and Ingram (2001), Chang, Gomes, and Schorfheide (2002),
• New Keynesian DSGE’s: Rabanal and Rubio-Ramırez (2003, 2005), Lubik and Schorfheide
(2004), Schorfheide (2005), Canova (2004), Galı́ and Rabanal (2004), Smets and
Wouters (2003, 2005), Laforte (2004), Onatski and Williams (2004), and Levin, Onatski,
• SOE models: Lubik and Schorfheide (2003), Del Negro (2003), Justiniano and Preston
• Multi-country models: Lubik and Schorfheide (2005), Rabanal and Tuesta (2005), and
• ...
Frank Schorfheide, University of Pennsylvania: Bayesian Methods 16
Further Extensions
• DSGE model with regime switches (inflation target) in monetary policy rule: Schorfheide
• DSGE model embedded in a factor model: Boivin and Giannoni (2005) “DSGE Models
• DSGE models with heteroskedastic shocks: Justiniano and Primiceri (2005) “The