0% found this document useful (0 votes)
3 views

lecture_1

The document discusses Bayesian analysis in the context of Dynamic Stochastic General Equilibrium (DSGE) models, focusing on Bayesian inference, model representation, and estimation techniques. It contrasts VAR and DSGE models, detailing their likelihood functions, prior distributions, and posterior sampling methods. The document also outlines the structure of households and firms within the DSGE framework, along with model solutions, equilibrium conditions, and Bayesian estimation processes.

Uploaded by

jessezheng742247
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

lecture_1

The document discusses Bayesian analysis in the context of Dynamic Stochastic General Equilibrium (DSGE) models, focusing on Bayesian inference, model representation, and estimation techniques. It contrasts VAR and DSGE models, detailing their likelihood functions, prior distributions, and posterior sampling methods. The document also outlines the structure of households and firms within the DSGE framework, along with model solutions, equilibrium conditions, and Bayesian estimation processes.

Uploaded by

jessezheng742247
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

Bayesian Analysis of Dynamic Stochastic General

Equilibrium Models

Frank Schorfheide
University of Pennsylvania, CEPR, NBER

June 19, 2013


Bayesian Inference

• Goals: conditional on prior information and sample information Y


we want to
• characterize uncertainty about θ, f (θ), or future y ’s;
• make optimal decisions that reflect our uncertainty about model
parameters
• Our models (VAR, DSGE, etc.) deliver a likelihood function p(Y |θ).
• We represent our ignorance/knowledge about θ using a prior
probability distribution with density p(θ).
• In view of the data Y , we update the prior

p(Y |θ)p(θ)
p(θ|Y ) = R (Bayes Theorem)
p(Y |θ)p(θ)dθ
• In practical work, we use algorithms to generate draws from the
posterior distribution p(θ|Y ), say, {θ(s) }ns=1
sim
.
• Once we have these draws we can
• compute point estimates, credible intervals, or plot
histograms/densities of posterior distributions;
• compute decisions that minimize posterior expected loss.
Frank Schorfheide Bayesian Analysis of DSGE Models
VAR vs. DSGE
VAR DSGE Model
yt = Ψ(θ)st
Representation yt = Byt−1 + ut
st = Φ1 (θ)st−1 + Φ (θ)
ut ∼ N(0, Σ) t ∼ N(0, I )
Need to solve the DSGE
numerically
to obtain Ψ(θ), Φ1 (θ), Φ (θ)
Likelihood Fcn Available in analytical form Has to be evaluated numerically:
p(Y |θ) - Kalman filter
- particle filter
Prior p(θ) e.g. Minnesota prior see empirical applications
Posterior p(θ|Y ) Analytical characterization No analytical characterization
Sampling from - Direct Sampling - Metropolis-Hastings Algo.
Posterior: {θ(s) }ns=1
sim
- Gibbs Sampling - (other methods)
Reporting Use {θ(s) }ns=1
sim
draws to compute mean, std, percentiles,
histograms, density estimates, etc.
Impulse Responses, Convert {θ(s) }ns=1
sim
draws into IRFs {f (θ(s) )}ns=1
sim
,
etc. compute mean, percentiles, etc. from {f (θ(s) )}ns=1 sim
,
Frank Schorfheide Bayesian Analysis of DSGE Models
Household
• Preferences:

" #
(Ht+s /Bt+s )1+1/ν
X 
Et β t+s ln Ct+s − (1)
s=0
1 + 1/ν

• Budget constraint:

Ct + It ≤ Wt Ht + Rt Kt .

• Capital accumulation:

Kt+1 = (1 − δ)Kt + It , (2)

• First-order conditions:
   1/ν
1 1 1 1 Ht
= βE (Rt+1 + (1 − δ)) and Wt = .
Ct Ct+1 Ct Bt Bt
(3)

Frank Schorfheide Bayesian Analysis of DSGE Models


Firms

• Technology:

Yt = (At Ht )α Kt1−α . (4)

• First-order conditions from profit maximization:

Yt Yt
Wt = α , Rt = (1 − α) . (5)
Ht Kt

• Market clearing:

Yt = Ct + It . (6)

Frank Schorfheide Bayesian Analysis of DSGE Models


Exogenous Processes
• Log Technology:

ln At = ln A0 + (ln γ)t + ln A
et , ln A
e t = ρa ln A
e t−1 + σa a,t (7)

where a,t ∼ iidN(0, 1).


• Preference shifter:

ln Bt = (1 − ρb ) ln B∗ + ρb ln Bt−1 + σb b,t (8)

where b,t ∼ iidN(0, 1).


• Initialzation:

ln A
e −τ = 0 and ln B−τ = 0.

Frank Schorfheide Bayesian Analysis of DSGE Models


Model Solution
• The solution to the rational expectations difference equations
determines law of motion for Yt , Ct , It , Kt , Ht , Wt , and Rt .
• The technology process ln At induces a common trend in output,
consumption, investment, capital, and wages.
• It is useful to detrended the model variables as follows:

et = Yt , C
Y et = Ct , eIt = It , K
et+1 = Kt+1 , W
ft = Wt . (9)
At At At At At

Frank Schorfheide Bayesian Analysis of DSGE Models


Equilibrium Conditions, Rewritten

" #  1/ν
1 1 −at+1 1 f 1 Ht
= βE e (Rt+1 + (1 − δ)) , Wt = (10)
Ct
e C
et+1 Ct
e Bt Bt
Y
et Yet
W
ft = α , Rt = (1 − α) e at
Ht Kt
e
 1−α
Y
et = Htα K et e −at , Y
et = C
et + eIt , K et e −at + eIt .
et+1 = (1 − δ)K

• The process at is defined as

At
at = ln = ln γ + (ρa − 1) ln A
e t−1 + σa a,t . (11)
At−1

• This log ratio is always stationary, because if ρa = 1 the ln A


e t−1
term drops out.

Frank Schorfheide Bayesian Analysis of DSGE Models


Steady State, Etc.
• Steady state:

  e
γ K
e∗ (1 − α)γ eI∗ 1−δ K ∗
R∗ = − (1 − δ), = , = 1− .
β Y∗
e R∗ Y∗
e γ Y∗
e
(12)

• If ρa = 1, the model generates cointegration relationships which are


obtained by taking pair-wise differences of ln Yt , ln Ct , ln It , ln Kt+1 ,
and ln Wt
• Parameters are stacked in vector θ:

θ = [α, β, γ, δ, ν, ρa , σa , ρb , σb ]0 . (13)

Frank Schorfheide Bayesian Analysis of DSGE Models


Loglinearization

 
R∗
C
bt = Et C at+1 −
bt+1 + b Rt+1
b (14)
R∗ + (1 − δ)
H
bt = ct − ν C
νW bt + (1 + ν)Bbt , W ct = Y bt − Hbt ,

bt+1 = 1 − δ K bt + I∗ bIt − 1 − δ b
e
R
bt = bt − K
Y bt + b
at , K at ,
γ Ke∗ γ

bt = C∗ C bt + I∗ bIt ,
e e
Y
bt = αHb t + (1 − α)Kbt − (1 − α)b at , Y
Y
e∗ Y
e∗
A
bt = ρa A
b t−1 + σa a,t , b bt − A
at = A b t−1 , B
bt = ρb B
bt−1 + σb b,t .

Log-linearization of f (x):
z
1 write f (x) = f (e );

2 conduct a first-order Taylor approximation around x0 in terms of z:

f (e ln x ) ≈ f (x0 ) + x0 f (1) (x0 )(ln x − ln x0 ).

Frank Schorfheide Bayesian Analysis of DSGE Models


State-Space Representation
• State-Transition:

st = Φ1 (θ)st−1 + Φ (θ)t . (15)

• Measurement:

yt = Ψ0 (θ) + Ψ1 (θ)t + Ψ2 (θ)st (16)

Frank Schorfheide Bayesian Analysis of DSGE Models


Examples
• Observations on GDP and Hours:
      " #
ln GDPt ln Y0 ln γ Y
bt + Abt
= + t+ ,
ln Ht ln H∗ 0 Ht
b

• Observations on GDP and Investment:


      " #
ln GDPt ln Y0 ln γ A
bt + Y
bt
= + t+ b .
ln It ln Y0 + (ln eI∗ − ln Y
e∗ ) ln γ At + bIt

• Cointegration relationship for ρa = 1:


   
  ln GDPt (1 − α)(γ − 1 + δ)
−1 1 = ln + bIt − Y
bt .
ln It γ/β − 1 + δ

Frank Schorfheide Bayesian Analysis of DSGE Models


Bayesian Estimation – Prior

Name Domain Density Para (1) Para (2)


α [0, 1) Beta 0.66 0.02
ν R+ Gamma 2.00 1.00
4 ln γ R Normal 0.00 0.10
ρa R+ Beta 0.95 0.02
σa R+ InvGamma 0.01 4.00
ρb R+ Beta 0.80 0.10
σb R+ InvGamma 0.01 4.00
ln H∗ R Normal 0.00 10.0
ln Y0 R Normal 0.00 100

Frank Schorfheide Bayesian Analysis of DSGE Models


Random-Walk Metropolis (RWM) Algorithm for DSGE
Model
1 Use a numerical optimization routine to maximize the log posterior,
which up to a constant is given by ln p(Y |θ) + ln p(θ). Denote the
posterior mode by θ̃.
2 Let Σ̃ be the inverse of the (negative) Hessian computed at the
posterior mode θ̃, which can be computed numerically.
3 Draw θ(0) from N(θ̃, c02 Σ̃) or directly specify a starting value.
4 For s = 1, . . . , nsim : draw ϑ from the proposal distribution
N(θ(s−1) , c 2 Σ̃). The jump from θ(s−1) is accepted (θ(s) = ϑ) with
probability min {1, r (θ(s−1) , ϑ|Y )} and rejected (θ(s) = θ(s−1) )
otherwise. Here
p(Y |ϑ)p(ϑ)
r (θ(s−1) , ϑ|Y ) = . 2
p(Y |θ(s−1) )p(θ(s−1) )

Frank Schorfheide Bayesian Analysis of DSGE Models


Posterior

Det. Trend Stoch. Trend


Name Mean 90% Intv. Mean 90% Intv.
α 0.65 [0.62, 0.68] 0.65 [0.63, 0.69]
ν 0.42 [0.16, 0.67] 0.70 [0.22, 1.23]
4 ln γ .003 [.002, .004] .004 [.002, .005]
ρa 0.97 [0.95, 0.98] 1.00
σa .011 [.010, .012] .011 [.010, .012]
ρb 0.98 [0.96, 0.99] 0.98 [0.96, 0.99]
σb .008 [.007, .008] .007 [.006, .008]
ln H∗ -0.04 [-0.08, 0.01] -0.03 [-0.07, 0.02]
ln Y0 8.77 [8.61, 8.93] 8.39 [7.93, 8.86]

Frank Schorfheide Bayesian Analysis of DSGE Models


The Next Steps
1 Solving DSGE models
2 Computation of likelihood function
3 Bayesian estimation of DSGE models
4 A detailed application illustrating the methods and highlighting
challenges

Some readings (see my website):


• An, S. and F. Schorfheide (2007): “Bayesian Analysis of DSGE Models,”
Econometric Reviews, 26(2-4), 113-172.
• Del Negro, M. and F. Schorfheide (2011): “Bayesian Macroeconometrics,” in J.
Geweke, G. Koop, and H. van Dijk (eds.) The Oxford Handbook of Bayesian
Econometrics, Oxford University Press, 293-389.
• Del Negro, M. and F. Schorfheide (2012): “DSGE Model-Based Forecasting,”
prepared for G. Elliot and A. Timmermann (eds.) Handbook of Economic
Forecasting, vol 2, Elsevier North Holland, forthcoming.
• Schorfheide, F. (2010): “Estimation and Evaluation of DSGE Models: Progress
and Challenges” Invited Lecture at 2010 Econometric Society World Congress in
Shanghai, available as NBER Working Paper, 16781.

Frank Schorfheide Bayesian Analysis of DSGE Models


Solving DSGE Models

A Primer on DSGE Model Solutions

Frank Schorfheide Bayesian Analysis of DSGE Models


Recall the Equilibrium Conditions

" #  1/ν
1 1 −at+1 1 f 1 Ht
= βE e (Rt+1 + (1 − δ)) , Wt =
Ct
e C
et+1 Ct
e Bt Bt
Y
et Yet
W
ft = α , Rt = (1 − α) e at
Ht Kt
e
 1−α
Y
et = Htα K et e −at , Y
et = C
et + eIt , K et e −at + eIt
et+1 = (1 − δ)K

At
at = ln = ln γ + (ρa − 1) ln A
e t−1 + σa a,t .
At−1

Frank Schorfheide Bayesian Analysis of DSGE Models


DSGE Model Solutions

• Find solution to nonlinear rational expectations difference equations


that satisfy additional optimality conditions for underlying
optimization problems (e.g. transversality)

• Useful to distinguish between state and control variables based on


the underlying dynamic programming problem. Solution can be
represented as a law of motion for the state variables and a mapping
from the states into controls:
• Exogenous states: at , ln A e t , Bt
• Endogenous states: K et
• Controls: C
et , H
e t , eIt

• In general, state transition as well as mapping from states to


controls is nonlinear.

• We can either use a local Taylor-type approximation near a steady


state; orPa global approximation, say, via Chebyshev polynomials:
N
f (x) ≈ n=0 αn Tn (x).

Frank Schorfheide Bayesian Analysis of DSGE Models


DSGE Model Solutions
• We will focus mostly on log-linear (or first-order perturbation)
approximations.
• In a nutshell... consider the backward-looking model

yt = f (yt−1 , σut ).

• Guess that the solution is of the form


(0) (1)
yt = yt + σyt + o(σ).
(0)
• Expand f (·) around σ = 0 assuming that steady state yt = 0:

f (yt−1 , σut ) = fy yt−1 + fu σut + o(|yt−1 |) + o(σ)

• Now plug-in conjectured solution:

(1) (1)
σyt = fy σyt−1 + fu σut + o(σ)
(1) (1)
• Deduce that yt = fy yt−1 + fu ut

Frank Schorfheide Bayesian Analysis of DSGE Models


DSGE Model Solutions
• A second-order perturbation essentially amounts to:
(0) (1) (2)
yt = yt + σyt + σ 2 yt + o(σ 2 )
(0)
• Expand f (·) around σ = 0 assuming that yt = 0:
f (yt−1 , σut ) ≈ fy yt−1 + fu σut
2
+fyu yt−1 σut + 0.5fyy yt−1 + 0.5fuu σ 2 ut2 + small
• Plug-in conjectured solution:
(1) (2) (1) (2)
σyt + σ 2 yt ≈ fy (σyt−1 + σ 2 yt−1 ) + fu σut
(1) (2)
+fyu (σyt−1 + σ 2 yt−1 )σut
(1) (2)
+0.5fyy (σyt−1 + σ 2 yt−1 )2
+fuu σ 2 ut + o(σ 2 )
• Equate similar terms (similar with respect to σ) on the left and the
right to obtain,
(1) (1)
yt = fy yt−1 + fu ut
(2) (2) (1) (1)
yt = fy yt−2 + fyu yt−1 ut + 0.5fyy [yt−1 ]2 + 0.5fuu ut2

Frank Schorfheide Bayesian Analysis of DSGE Models


Next Steps

• Notice that:
• (log)linear solutions lead to linear state-space models;
• nonlinear solutions lead to nonlinear state-space models

• We will now review some of the details for linear solution techniques
and discuss multiplicity issues

• Later on, we also discuss the estimation of nonlinearly solved DSGE


models (but without reviewing solution techniques in detail)

Frank Schorfheide Bayesian Analysis of DSGE Models


Solving Linearized DSGE Models
• Linearized DSGE leads to linear rational expectations (LRE) system:

Γ0 (θ)st = Γ1 (θ)st−1 + Ψt + Πηt

where
• st is a vector of model variables, t is a vector of exogenous shocks,
• ηt is a vector of RE errors with elements ηtx = x̂t − Et−1 [x̂t ], and
• st contains (among others) the conditional expectation terms
Et [e
xt+1 ].
• Solution methods for LREs: Blanchard and Kahn (1980), King and
Watson (1998), Uhlig (1999), Anderson (2000), Klein (2000),
Christiano (2002), Sims (2002).
• Typically, the solution in terms of st is of the form

st = Φ1 (θ)st−1 + Φ (θ)t .

Frank Schorfheide Bayesian Analysis of DSGE Models


Simple Example
• Simple model:

1
yt = Et [yt+1 ] + t ,
θ
where t ∼ iid(0, 1) and θ ∈ Θ = [0, 2].
• Introduce conditional expectation ξt = Et [yt+1 ] and forecast error
ηt = yt − ξt−1 .
• Thus,

ξt = θξt−1 − θt + θηt .

• Canonical LRE model (Sims, 2002)

Γ0 (θ)st = Γ1 (θ)st−1 + Ψ(θ)t + Π(θ)ηt .

Frank Schorfheide Bayesian Analysis of DSGE Models


Simple Example
• Determinacy: θ > 1. Then only stable solution:

ξt = 0, ηt = t , yt = t

• Indeterminacy: θ ≤ 1 the stability requirement imposes no


restrictions on forecast error:

ηt = M
e t + ζt .

• For simplicity assume now ζt = 0. Then

yt − θyt−1 = M
e t − θt−1 .

Frank Schorfheide Bayesian Analysis of DSGE Models


Simple Example
• Re-parameterization M
e = 1 + M. The indeterminacy region of the
parameter space is labelled ΘI = [0, 1].
• Then

(1 − θL)yt = (1 − θL)t + Mt

• Or

yt = t + M(1 − θL)−1 t

Frank Schorfheide Bayesian Analysis of DSGE Models


Generalization
• Canonical form:

Γ0 (θ)st = Γ1 (θ)st−1 + Ψ(θ)t + Π(θ)ηt ,

• The system can be rewritten as

st = Γ∗1 (θ)st−1 + Ψ∗ (θ)t + Π∗ (θ)ηt .

• Replace Γ∗1 by JΛJ −1 and define wt = J −1 st .

• To deal with repeated eigenvalues and non-singular Γ0 we use


Generalized Complex Schur Decomposition (QZ) in practice.

• Let the i’th element of wt be wi,t and denote the i’th row of J −1 Π∗
and J −1 Ψ∗ by [J −1 Π∗ ]i. and [J −1 Ψ∗ ]i. , respectively.

Frank Schorfheide Bayesian Analysis of DSGE Models


Generalization
• Rewrite model:

wi,t = λi wi,t−1 + [J −1 Π∗ ]i. t + [J −1 Ψ∗ ]i. ηt .

• Define the set of stable AR(1) processes as


 
Is (θ) = i ∈ {1, . . . n} |λi (θ)| ≤ 1

• Let Ix (θ) be its complement. Let ΨJx and ΠJx be the matrices
composed of the row vectors [J −1 Ψ∗ ]i. and [J −1 Π∗ ]i. that
correspond to unstable eigenvalues, i.e., i ∈ Ix (θ).
• Stability condition:

ΨJx t + ΠJx ηt = 0

for all t.

Frank Schorfheide Bayesian Analysis of DSGE Models


Generalization
• Solve system of equations ΨJx t + ΠJx ηt = 0 for ηt , i.e.

η t = η 1 t + η 2 ζ t .

• Then plug solution for ηt into

Γ0 (θ)st = Γ1 (θ)st−1 + Ψ(θ)t + Π(θ)ηt .

Frank Schorfheide Bayesian Analysis of DSGE Models

You might also like