0% found this document useful (0 votes)
9 views107 pages

Monash Estimation-1

The document discusses methods for parametrizing DSGE models, focusing on estimation techniques such as Maximum Likelihood and Bayesian estimation. It outlines alternatives like calibration and moment matching, emphasizing the importance of selecting appropriate parameters based on real-world data features. Additionally, it introduces the Kalman filter for estimating unobserved states in time-series models, which is crucial for effective model forecasting.

Uploaded by

jessezheng742247
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views107 pages

Monash Estimation-1

The document discusses methods for parametrizing DSGE models, focusing on estimation techniques such as Maximum Likelihood and Bayesian estimation. It outlines alternatives like calibration and moment matching, emphasizing the importance of selecting appropriate parameters based on real-world data features. Additionally, it introduces the Kalman filter for estimating unobserved states in time-series models, which is crucial for effective model forecasting.

Uploaded by

jessezheng742247
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 107

Introduction

How to parametrize a model


Maximum Likelihood
Bayesian estimation: the basics
Summary

Monash Macroeconomics
Summer School
Parametrizing models:
Estimation

Petr Sedláček

University of Bonn

February 2016

Sedláček Monash Macro


Introduction
How to parametrize a model
Maximum Likelihood
Bayesian estimation: the basics
Summary

Goal
Parametrizing DSGE models, in particular via estimation
discussion of alternatives
Maximum Likelihood estimation
Kalman filter (based on Hamilton, 1994)
DSGE models in state-space form
singularity problem
Bayesian estimation
priors
evaluating the posterior
Markov-Chain Monte-Carlo (MCMC) methods
practical issues
Sedláček Monash Macro
Introduction
Discussion of alternatives
How to parametrize a model
Calibration
Maximum Likelihood
Moment matching
Bayesian estimation: the basics
Maximum Likelihood and Bayesian
Summary

How to parametrize a model

Sedláček Monash Macro


Introduction
Discussion of alternatives
How to parametrize a model
Calibration
Maximum Likelihood
Moment matching
Bayesian estimation: the basics
Maximum Likelihood and Bayesian
Summary

Quantitative analysis of DSGE models

By now you know how to

write down a DSGE model


and solve it for a particular set of parameters (!)

But how to choose “the right” parameters?

Sedláček Monash Macro


Introduction
Discussion of alternatives
How to parametrize a model
Calibration
Maximum Likelihood
Moment matching
Bayesian estimation: the basics
Maximum Likelihood and Bayesian
Summary

Alternatives for model parametrization

calibration
estimation
Maximum Likelihood
Bayesian
moment matching (GMM, SMM, II)

combination of the two above

Sedláček Monash Macro


Introduction
Discussion of alternatives
How to parametrize a model
Calibration
Maximum Likelihood
Moment matching
Bayesian estimation: the basics
Maximum Likelihood and Bayesian
Summary

Calibration

wide-spread methodology
at least since Kydland and Prescott (1982)

before, simultaneous equations systems were state-of-the-art


those were viewed as “true statistical” models to be estimated

Sedláček Monash Macro


Introduction
Discussion of alternatives
How to parametrize a model
Calibration
Maximum Likelihood
Moment matching
Bayesian estimation: the basics
Maximum Likelihood and Bayesian
Summary

Calibration

although calibration is also an empirical exercise


it lacks the probabilistic interpretation
constrained by (a priori identified) features in the data
Kydland and Prescott (1996):
It is important to emphasize that the parameter values selected are
not the ones that provide the best fit in some statistical sense.

Sedláček Monash Macro


Introduction
Discussion of alternatives
How to parametrize a model
Calibration
Maximum Likelihood
Moment matching
Bayesian estimation: the basics
Maximum Likelihood and Bayesian
Summary

Calibration

Parameters are pinned down by a selection of real-world features

long-run averages (labor share, hours worked)


micro studies (preference parameters)
certain business cycle properties of the data etc.

Sedláček Monash Macro


Introduction
Discussion of alternatives
How to parametrize a model
Calibration
Maximum Likelihood
Moment matching
Bayesian estimation: the basics
Maximum Likelihood and Bayesian
Summary

Calibration

compare different features of the data to model predictions


closely related to moment-matching (estimating models)
however, calibration lacks the statistical formality
the above is a strong source of criticism of calibration
no formal rules for targets to which model is fit
no formal rules for moments along which model is “evaluated”
no formal rules of comparing alternatives

Sedláček Monash Macro


Introduction
Discussion of alternatives
How to parametrize a model
Calibration
Maximum Likelihood
Moment matching
Bayesian estimation: the basics
Maximum Likelihood and Bayesian
Summary

Matching moments (GMM, SMM, II)

idea similar to calibration:


parametrize by a set of moments (features) of the data
judge model performance by a different set of moments

matching moments adds statistical rigor


estimation
hypothesis testing

Sedláček Monash Macro


Introduction
Discussion of alternatives
How to parametrize a model
Calibration
Maximum Likelihood
Moment matching
Bayesian estimation: the basics
Maximum Likelihood and Bayesian
Summary

Matching moments (GMM, SMM, II)

moment matching needs a selection of moments


often referred to as limited-information procedures
“full information” contained in model’s likelihood function
disadvantages of limited-information procedures
potential loss of efficiency
inference potentially sensitive to selected moments

advantages of limited-information procedures


no need to make distributional assumptions

Sedláček Monash Macro


Introduction
Discussion of alternatives
How to parametrize a model
Calibration
Maximum Likelihood
Moment matching
Bayesian estimation: the basics
Maximum Likelihood and Bayesian
Summary

Generalized method of moments

attributed to Hansen (1982)


generalization, asymptotic properties

the main idea is to use “orthogonality conditions”


e.g. first-order-conditions
E[f (xt , Ψ)] = 0

xt is a vector of variables
Ψ are model parameters

Sedláček Monash Macro


Introduction
Discussion of alternatives
How to parametrize a model
Calibration
Maximum Likelihood
Moment matching
Bayesian estimation: the basics
Maximum Likelihood and Bayesian
Summary

Generalized method of moments

pick Ψ s.t. the sample analogs of orthogonality conditions


X
g (X , Ψ) = 1/T f (xt , Ψ)
t

hold exactly: “exactly identified case”


number of parameters = number of moment conditions

are as close to zero as possible: “overidentified case”


are number of parameters < number of moment conditions

Sedláček Monash Macro


Introduction
Discussion of alternatives
How to parametrize a model
Calibration
Maximum Likelihood
Moment matching
Bayesian estimation: the basics
Maximum Likelihood and Bayesian
Summary

Generalized method of moments

in the over-identified case

min g (X , Ψ)0 Ωg (X , Ψ)
Ψ

Ω is a weighting matrix
optimal weighting matrix:
inverse of the var-covar matrix of g (X , Ψ)

Sedláček Monash Macro


Introduction
Discussion of alternatives
How to parametrize a model
Calibration
Maximum Likelihood
Moment matching
Bayesian estimation: the basics
Maximum Likelihood and Bayesian
Summary

Simulated method of moments

sometimes orthog. conditions cannot be assessed analytically


moment-matching estimation based on simulations
retains asymptotic properties of GMM

Sedláček Monash Macro


Introduction
Discussion of alternatives
How to parametrize a model
Calibration
Maximum Likelihood
Moment matching
Bayesian estimation: the basics
Maximum Likelihood and Bayesian
Summary

Indirect inference

based on reduced-form models


main idea: use structural model to gauge reduced-form results
can simulated data from a structural model
replicate a reduced-form estimate using real-world data?

i.e. it is a moment-matching exercise


moments are clearly defined by prior reduced-form analysis

Sedláček Monash Macro


Introduction
Discussion of alternatives
How to parametrize a model
Calibration
Maximum Likelihood
Moment matching
Bayesian estimation: the basics
Maximum Likelihood and Bayesian
Summary

Indirect inference

let δ be a vector of reduced-form estimates


δ(xt ): those in the data
δ(zt , Ψ): those from the model

pick Ψ s.t.
δ(xt ) = δ(zt , Ψ)

Sedláček Monash Macro


Introduction
Discussion of alternatives
How to parametrize a model
Calibration
Maximum Likelihood
Moment matching
Bayesian estimation: the basics
Maximum Likelihood and Bayesian
Summary

Maximum Likelihood and Bayesian

both are so-called “full information” methods


require assumptions on entire distributions

both very closely linked in terms of tools


but both completely different conceptually

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Maximum Likelihood estimation

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Let’s start more generally

Before diving into specifics of DSGE models

first talk about time-series models and the Kalman filter


introduce a general time-series (state-space) model
derive the Kalman filter
go back to DSGE models
how to write a DSGE model in state-space form?
what particular issues will we face?

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Time series model

yt =H 0 ζt + wt , E(wt , wt0 ) = R ∀t
ζt+1 =F ζt + vt+1 , E(vt , vt0 ) =Q ∀t

yt is observed, but ζt is not


Kalman filter enables you to get an estimate of ζt

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Some preliminaries

for now assume coefficients are known


later on we will show how to estimate them
they could even be time-varying

initial conditions: ζ1 has mean ζb1|0 and variance P1|0


state and observation disturbances are
uncorrelated over time
uncorrelated with each other (at all leads and lags)
orthogonal to ζ1

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Purpose of the Kalman filter

calculate the expectation of the unobserved states


given observations on y
b t+1 |Yt ),
ζbt+1 = E(ζ

Yt = (yt0 , yt−1
0
, ..., y10 )

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

What is the objective?


How to pick the (right) forecast?

specify a loss function (objective function)


evaluate the “usefulness” of the forecast according to it
convenient results obtained with a quadratic loss function

min E (ζt+1 − ζbt+1|t )2

smallest-MSE forecast is the conditional expectation of ζt+1


assuming a linear functional form
→ ζbt+1|t is a linear projection of ζt+1 on its regressors

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Linear projection digression

closely related to OLS


assume existence of following first and second moments:
z = E [z], x = E [x]
Σz,z = E [(z − z)(z − z)0 ]
Σx,x = E [(x − x)(x − x)0 ]
Σz,x = E [(z − z)(x − x)0 ]

linear projection (of z on x) is a function Eb[z|x] = a + bx

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Linear projection digression

linear projection picks a and b to minimize MSE:


Σz,x
b=
Σx,x
a =z − bx

Σz,x
zb = Eb(z|x) = z + (x − x)
Σx,x

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Linear projection vs. linear regression

linear regression (OLS) seeks effect of x on z


keeping all else (including error term) constant
linear projection is concerned “only” with forecasting
→ doesn’t matter if x → z or z → x

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Back to the Kalman filter

purpose of Kalman filter is to estimate unobserved states


will do so using linear projections (given data and structure)
main trick is to formulate it recursively

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Formulating a recursive scheme

Main idea of the Kalman filter recursions:


given starting values for ζ1|0 and observation of y1

→ forecast ζb2|1

given ζb2|1 and observation of y2

→ forecast ζb3|2 ...

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Formulating a recursive scheme

For convenience, split the above into the following steps:


given starting values for ζ1|0 and observation of y1

→update state ζb1|1

given ζb1|1 and model structure

→ forecast ζb2|1 ...

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

1. Update step
use linear projection to produce update of ζt
conditional on expectations from t − 1
conditional on observation of yt

Σz,x
zb = Eb(z|x) = z + (x − x)
Σx,x

b t |Yt ] = ζbt|t−1 +
ζbt|t =E[ζ (1)
h i
−1
E (ζt − ζbt|t−1 )(yt − ybt|t−1 )0 xE (yt − ybt|t−1 )(yt − ybt|t−1 )0
 
x
(yt − ybt|t−1 )

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

2. Forecast step

use model structure to forecast the state


b [ζt+1 |Yt ]
ζbt+1|t =E (2)
b [ζt |Yt ] + E
=F E b [vt+1 |Yt ]
b [ζt |Yt ]
=F E

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Using the model structure

covariance term

h i
E (ζt − ζbt|t−1 )(yt − ybt|t−1 )0 (3)
h i
= E (ζt − ζbt|t−1 )(H 0 (ζt − ζbt|t−1 ) + wt )0
h i
= E (ζt − ζbt|t−1 )(ζt − ζbt|t−1 )0 H
= Pt|t−1 H

Pt|t−1 is the related MSE

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Using the model structure

variance term

E (yt − ybt|t−1 )(yt − ybt|t−1 )0


 
(4)
h i
= E H 0 (ζt − ζbt|t−1 )(ζt − ζbt|t−1 )H + E wt wt0
 

= H 0 Pt|t−1 H + R

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Using the model structure

error term

yet|t−1 = yt − ybt|t−1 = yt − H 0 ζbt|t−1 (5)

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Collapsing the two steps

Combining (1) and (2) and using (3) to (5) we can write

ζbt+1|t = F ζbt|t−1 + FPt|t−1 H(H 0 Pt|t−1 H + R)−1 (yt − H 0 ζbt|t−1 )


| {z }
Kalman gain

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

We’re not done yet


Still need to define recursions for MSE’s:
Update step (use (1) to substitute out ζbt|t )
h i
Pt|t =E (ζt − ζbt|t )(ζt − ζbt|t )0 (6)
h i
=E (ζt − ζbt|t−1 )(ζt − ζbt|t−1 )0
h i
− E (ζt − ζbt|t−1 )(yt − ybt|t−1 )0 x
−1
E (yt − ybt|t−1 )(yt − ybt|t−1 )0

x
h i
E (yt − ybt|t−1 )(ζt − ζbt|t−1 )0
=Pt|t−1 − Pt|t−1 H(H 0 Pt|t−1 H 0 + R)−1 H 0 Pt|t−1

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

We’re not done yet

Forecast step (use (2) to substitute out ζbt+1|t )

h i
Pt+1|t =E (ζt+1 − ζbt+1|t )(ζt+1 − ζbt+1|t )0 (7)
h i
=E (F ζt + vt+1 − F ζbt|t )(F ζt + vt+1 − F ζbt|t )0
h i
=F E (ζt − ζbt|t )(ζt − ζbt|t )0 F 0 + E vt+1 vt+1
0
 

=FPt|t F 0 + Q

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Collapsing the two steps

Combining (6) and (7) we can write

Pt+1|t = F Pt|t−1 − Pt|t−1 H(H 0 Pt|t−1 H 0 + R)−1 H 0 Pt|t−1 F 0 + Q


 

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Summary of recursive formulation

update:

ζbt|t = ζbt|t−1 + Pt|t−1 H(H 0 Pt|t−1 H + R)−1 (yt − H 0 ζbt|t−1 )

Pt|t = Pt|t−1 − Pt|t−1 H(H 0 Pt|t−1 H 0 + R)−1 H 0 Pt|t−1

forecast:
ζbt+1|t = F ζbt|t
Pt+1|t = FPt|t F 0 + Q

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Summary of recursive formulation

combined specification:

ζbt+1|t = F ζbt|t−1 + Kt (yt − H 0 ζbt|t−1 )

Kt = FPt|t−1 H(H 0 Pt|t−1 H + R)−1


Pt+1|t = F Pt|t−1 − Pt|t−1 H(H 0 Pt|t−1 H 0 + R)−1 H 0 Pt|t−1 F 0 + Q
 

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

J. R. Statist. Soc. A (2014)

A dynamic bivariate Poisson model for analysing


and forecasting match results in the English Premier
League

Siem Jan Koopman and Rutger Lit


VU University Amsterdam, The Netherlands

[Received September 2012. Revised July 2013]

Summary. We develop a statistical model for the analysis and forecasting of football match
results which assumes a bivariate Poisson distribution with intensity coefficients that change
stochastically over time. The dynamic model is a novelty in the statistical time series analysis of
match results in team sports. Our treatment is based on state space and importance sampling
methods which are computationally efficient. The out-of-sample performance of our methodol-
ogy is verified in a betting strategy that is applied to the match outcomes from the 2010–2011
and 2011–2012 seasons of the English g g
football Premier League. We show that our statistical
modelling framework can produce a significant positive return over the bookmaker’s odds.
Sedláček Monash Macro
Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Estimating parameters

up to now, we assumed that model parameters are known


we can also estimate them with Maximum Likelihood (ML)
i.e. given data on yt and initial conditions
estimate Ψ = [H, F , Q, R]
the Kalman filter is particularly convenient for this task

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Preliminaries

if ζ1|0 is Gaussian and {wt , vt }T


t=1 are Gaussian

→ distribution of yt conditional on Yt−1 is also Gaussian

yet|t−1 |Yt−1 ∼N(0, H 0 Pt|t−1 H + R)


yt |Yt−1 ∼N(H 0 ζbt|t−1 , H 0 Pt|t−1 H + R)

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Preliminaries

given values of Ψ → calculate mean and variance of y


we know the distribution of y
→ calculate the probability (likelihood) of (y1 , ..., yT )

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Likelihood function

the likelihood of a given (Gaussian) observation is

(x − µ)2
 
1
√ exp −
σ 2π 2σ 2

in our case this is

yt |Yt−1 ; Ψ) =(2π)−1/2 (H 0 Pt|t−1 H + R)−1/2 x


f (e (8)
0 0 −1

exp −1/2(yt − ybt|t−1 ) (H Pt|t−1 H + R) (yt − ybt|t−1 )
for t = 1, ..., T

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Likelihood function

we are interested in the likelihood of the entire sample

because forecast errors are orthogonal to each other


L(Yt |Ψ) = f (y0 ; Ψ)ΠT
t=1 f (yt |Yt−1 ; Ψ)

it is convenient to work with the sample log-likelihood:


T
X
log L(Yt |Ψ) = log f (y0 ) + log f (yt |Yt−1 ; Ψ)
t=1

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Why is the Kalman filter convenient?

the Kalman filter produces ybt|t−1 and Pt|t−1

the (log)-likelihood is easy to construct with the Kalman filter

one can then maximize it with respect to the parameters Ψ

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

What is the relation to DSGE models?

What next?

neoclassical growth model example


linearized equations

growth model in state-space form


Kalman filter and the likelihood
estimation
singularity problem

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Neoclassical growth model

 −υ
ct−ν =Et βct+1 (αzt+1 ktα−1 + 1 − δ)


α
ct + kt =zt kt−1 + (1 − δ)kt−1

zt =1 − ρ + ρzt−1 + t

t ∼ N(0, σ 2 )

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Linearized version

kt =k + akk (kt−1 − k) + akz (zt − z)


zt =1 − ρ + ρzt−1 + t
t ∼ N(0, σ 2 )
k0 given

akk , akz and k are known functions of structural parameters Ψ


Ψ = [α, β, ν, δ, ρ, σ, z0 ]

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Estimating structural parameters

consider estimating the structural parameters using ML

need a time-series for the structural shocks


this depends on model parameters
evaluate the likelihood of shocks for given Ψ

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Estimating structural parameters

how to obtain time-series for structural shocks?

in a simple model you can invert the policy function


for more complex models this doesn’t work
Kalman filter convenient for building likelihood function

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Putting model into state-space form

the neoclassical growth model is relatively simple


for more complex models, policy function inversion is tough
but we know that
the Kalman filter is convenient for likelihood construction
because it produces yt − ybt|t−1 and Pt|t−1

the question is how to cast DSGE model into state-space form

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

DSGE mode in state-space form

yt =H 0 ζt + wt , E(wt , wt0 ) = R ∀t
ζt+1 =F ζt + vt+1 , E(vt , vt0 ) =Q ∀t

what is the observable?


capital

what are the states?


capital
productivity (unobserved)
Sedláček Monash Macro
Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

DSGE mode in state-space form

      
kt − k akk akz kt−1 − k 0
= +
zt+1 − z 0 ρ zt − z t+1

 
kt−1 − k  
kt−1 − k = [1 0] + 0
zt − z

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Different observables?

What if we don’t have data on capital, but only on output (pt )?


      
kt − k akk akz kt−1 − k 0
= +
zt+1 − z 0 ρ zt − z t+1

i k 
t−1 − k
h
α−1 α  
pt − p = αzk k + 0
zt − z

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

What if we also observe productivity?

What if we observe capital and also productivity (zt )?

if our model is the true data-generating process


→ likelihood = 1 for true Ψ and 0 otherwise

if our model is not the true data-generating process


→ likelihood = 0 for any values of Ψ

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

What if we also observe productivity?


To understand the above notice that
with 4 periods of observations, you can pin down k, ρ, akk , akz
What about the other periods?

if our model is the true data-generating process


additional observations will fit the model equation

kt = k + akk (kt−1 − k) + akz (zt − z)

if our model is not the true data-generating process


additional observations will not fit the equation
→ likelihood is 0
Sedláček Monash Macro
Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Ways out?

can we simply add an error term?

kt = k + akk (kt−1 − k) + akz (zt − z) + ut

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Ways out?

if ut is a structural shock (e.g. preferences)


→ its law of motion influences policy function (k, akk , akz )

if ut is measurement error
OK from an econometric point of view
but is it truly measurement error?

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Singularity problem

(stochastic) singularity:
many endogenous variables ...
driven by a smaller number of structural shocks

→ some observables are linear combinations of others


→ the var-covar matrix of observables is singular
what is the problem mathematically?

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

General rule

for every observable, you need at least one unobservable shock


(letting them be measurement error is hard to defend)

Note that:
more shocks (measurement errors) than observables is OK
the choice of observables for estimation is not innocent
there are ways to choose observables carefully
see e.g. Canova, Ferroni, Matthes (2012)

Sedláček Monash Macro


Introduction Time series model
How to parametrize a model Kalman filter
Maximum Likelihood Maximum Likelihood estimation
Bayesian estimation: the basics Back to DSGE models and singularity problem
Summary Summary

Let’s see if we understand

what solution method would you choose?


when estimating a model with Maximum Likelihood

what about non-linear approximations?


does the Kalman filter give the best idea about ζt ?
Kalman smoother does better, why not use it in estimation?

many extensions to the basic filter


allowing for regressors
covariance term between shocks
missing observations/mixed frequencies etc.
Sedláček Monash Macro
Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Bayesian estimation: basic concepts

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Frequentist vs. Bayesian views

Frequentist view:

parameters are fixed, but unknown


likelihood is a sampling distribution for the data
realizations of observables Y T
just one of many possible realizations from L(Y T |Ψ)

inferences about Ψ
based on probabilities of particular Y T for given Ψ

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Frequentist vs. Bayesian views

Bayesian view:

observations, not parameters, are taken as given


Ψ are viewed as random
inference about Ψ
based on probabilities of Ψ conditional on data Y T P(Ψ|Y T )

probabilistic view of Ψ enables incorporation of prior beliefs

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Bayes’ rule

Joint density of the data and parameters is:

P(Y T , Ψ) =L(Y T |Ψ)P(Ψ) or


P(Y T , Ψ) =P(Ψ|Y T )P(Y T )

From the above we get Bayes’ rule:

L(Y T |Ψ)P(Ψ)
P(Ψ|Y T ) =
P(Y T )

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Elements of Bayes’ rule

what we’re interested in, posterior distribution: P(Ψ|Y T )


likelihood of the data: L(Y T |Ψ)
our prior about the parameters: P(Ψ)
probability of the data: P(Y T )
for the distribution of Ψ P(Y T ) is just a constant

P(Ψ|Y T ) ∝ L(Y T |Ψ)P(Ψ)

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

What is the challenge?

getting the posterior mode is typically not such a big deal


problem is that we often want to know more:
conditional expected values of some function of the posterior
like mean, variance, “highest-density-intervals” etc.

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

What is the challenge?

g (Ψ)P(Ψ|Y T )dΨ
R
E[g (Ψ)] = R
P(Ψ|Y T )dΨ

E[g (Ψ)] is the weighted average of g (Ψ)


weights are determined by the data (likelihood) and the prior

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

What is the challenge?

we need to be able to evaluate the integral!

Special/Simple case:

we are able to draw Ψ from P(Ψ|Y T )


can evaluate integral via Monte Carlo integration

you won’t be lucky enough to experience this case


we’ll talk about why later on

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Evaluating the posterior


Our situation:
we can calculate P(Ψ|Y T ), but we cannot draw from it
Solutions:
numerical integration
Markov Chain Monte Carlo (MCMC) integration
What is the standard?
although numerical integration is fast and accurate
computational burden rises exponentially with dimension
suited for low-dimension problems
→ use MCMC methods
Sedláček Monash Macro
Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Idea of priors

summarize prior information


previous studies
data not used in estimation
pre-sample data
other countries etc.
don’t be too restrictive
more on prior selection in “extensions”

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Priors

Most commonly used distributions:

normal
beta, support ∈ [0, 1]
persistence parameters

(inverted-) gamma, support ∈ (0, ∞)


volatility parameters

uniform
often (incorrectly) referred to as “uninformative”

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Prior predictive analysis

check whether priors “make sense”


use the prior as the posterior
steady state?
impulse response functions?

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Some terminology

Jeffreys prior
non-informative prior

improper vs. proper priors


improper prior is non-integrable (integral is ∞)
important to have proper distributions for model comparison

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Some terminology

(natural) conjugate priors


family of prior distributions
after multiplication with the likelihood
produce a posterior of the same family

Minnesota (Litterman) prior


used in VARs for distribution of lags

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Starting point

Aim is to be able to calculate something like

g (Ψ)P(Ψ|Y T )dΨ
R
E[g (Ψ)] = R
P(Ψ|Y T )dΨ

we know how to calculate P(Ψ|Y T )


but we cannot draw from it
the system is too large for numerical integration

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Principle of posterior evaluation

We cannot draw from the “target” distribution, but

1. can draw from a different, “stand-in”, distribution


2. can evaluate both stand-in and target distributions
3. comparing the two, we can re-weigh the draw “cleverly”

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Principle of posterior evaluation

the above procedure is the idea of “importance sampling”


MCMC methods effectively a version of importance sampling
traveling through the parameter space is more sophisticated
and or acceptance probability more sophisticated

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

A few simple examples


Problem:

we want to simulate x
x comes from truncated normal with
mean µ and variance σ 2
and a < x < b

Solution:

1. draw y from N(µ, σ 2 )


2a. if y ∈ (a, b) then keep draw (accept) and go back to 1
2b. otherwise discard draw (reject) and go back to 1
Sedláček Monash Macro
Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

A few simple examples


Problem:
want to draw x from F (x), but we cannot
we can sample from G (x) and f (x) ≤ cg (x) ∀x
Solution:
1. sample y from G (y )
f (y )
2. accept draw with probability cg (y ) and go back to 1
Note:
acceptance rate higher for lower c
optimal c is c = supx gf (x)
(x)
Metropolis-Hastings sampler (MCMC) is a generalization
Sedláček Monash Macro
Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Importance sampling

Main idea very similar to the previous example:

cannot draw from P(Ψ|Y T )


but can draw from H(Ψ)
be smart in reweighing (accepting) the draws

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Importance sampling

T
g (Ψ) P(Ψ|Y )
R
h(Ψ) h(Ψ)dΨ
E[g (Ψ)] = R P(Ψ|Y T )
h(Ψ) h(Ψ)dΨ

R
g (Ψ)ω(Ψ)h(Ψ)dΨ
= R
ω(Ψ)h(Ψ)dΨ

P(Ψ|Y T )
ω(Ψ) =
h(Ψ)

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Importance sampling

Approximate the integral using MC integration:


PM (m) )g (Ψ(m) )
m=1 ω(Ψ
E[g (Ψ)] ≈ PM (m) )
m=1 ω(Ψ

M is the number of draws from importance function h(Ψ)

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Importance sampling

How to best choose h(.)?

we’d like h(.) to have fatter tails compared to f (.)


normal distribution has rather thin tails
→ often not a good importance function

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Some preliminaries for MCMC

Markov property:

if for all k ≥ 1 and all t


P(xt+1 |xt , xt−1 , ..., xt−k ) = P(xt+1 |xt )

Transition kernel:

K(x, y ) = P(xt+1 = y |xt = x) for x, y ∈ X


X is the sample space

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Main idea behind MCMC methods

as before, we’d like to sample from P(Ψ|Y T ), but we cannot


MCMC methods provide a way to
create a transition kernel (K) for Ψ
that has an invariant density P(Ψ|Y T )

given K simulate the Markov chain P 0 = KP


starting with some initial values P(Ψ0 )

(eventually) distribution of Markov chain → P(Ψ|Y T )

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Main idea behind MCMC methods

a principle of constructing such kernels


→ Metropolis (-Hastings) algorithm (MH)
the Gibbs sampler is a special case

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Metropolis-Hastings algorithm
Main idea same as with importance sampling:

1. draw from a stand-in distribution h(Ψ; θ)


θ explicitly shows parameters of stand-in distribution
e.g. mean (µh ) and variance (σh2 )

2. accept/reject based on probability q(Ψi+1 |Ψi )


3. go back to 1
3a. stand-in density does not change (independent MH)
3b. mean of stand-in adjusts (random walk MH)

can show convergence to target distribution


Sedláček Monash Macro
Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Acceptance probability

“Metropolis”
" #
P(Ψ∗i+1 |Y T )
q(Ψi+1 |Ψi ) = min 1,
P(Ψi |Y T )

Ψ∗i+1 is the new candidate draw from stand-in distribution


if P(Ψ∗i+1 |Y T ) high relative to P(Ψi |Y T )
→ accept the draw

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Acceptance probability

“Metropolis-Hastings”
" #
P(Ψ∗i+1 |Y T ) h(Ψi ; θ)
q(Ψi+1 |Ψi ) = min 1,
P(Ψi |Y T ) h(Ψ∗i+1 ; θ)

scale down by relative likelihood in stand-in density


a more “common” draw from the stand-in gets less “weight”
→ q(Ψi+1 |Ψi ) is lowered
force algorithm to explore less likely areas

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Updating the stand-in density

“Independence chain variant”

stand-in distribution does not change


it is independent across Monte Carlo replications
this is also the case in importance-sampling

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Updating the stand-in density

“Random walk variant”

candidate draws are obtained according to Ψ∗i+1 = Ψi + i+1


i from a symmetric density around 0 and variance σh2
mean of the stand-in density adjusts with each accepted draw
in θ, µh = Ψi

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Choice of stand-in density

stand-in should have fatter tails


variance parameter important for acceptance rate
optimal acceptance rates:
around 0.44 for estimation of 1 parameter
around 0.23 for estimation of more than 5 parameters

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Choice of stand-in density

often, stand-in is N(Ψ̂, c 2 ΣΨ )


Ψ̂ is the posterior mode
ΣΨ is the inverse (negative) Hessian at the mode

tip: start with c = 2.4/ d
d is number of estimated parameters

increase (decrease) c if acceptance rate is too high (low)

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Convergence statistics

theory says that distribution will converge to target


when does this happen?
→ diagnostic tests
sequence of draws should be from the invariant distribution
moments should not change within/between sequences

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Brooks and Gelman statistics

I draws and J sequences


J I
1X 1 X 2
W = Ψi,j − Ψj
J I −1
j=1 i=1

J
I X 2
B= Ψj − Ψ
J
j=1

B/I : estimate of the variance of the mean across sequences


W : estimate of average variance within sequences

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Brooks and Gelman statistics

Combine the two measures of variance:


I −1 B
V = W+
I I

as the length of the simulation increases


want these statistics to “settle down”

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Geweke statistic

partition a sequence into 3 subsets s = {I , II , III }


s s )
compute mean (Ψ ) and standard errors (σΨ
s.e.’s must be corrected for serial correlation

then, under convergence CD is distributed N(0, 1)


I III
Ψ −Ψ
CD = I III
σΨ + σΨ

Sedláček Monash Macro


Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Summary of MCMC with MH algorithm

1. maximize log-posterior log P(Y T |Ψ) + log P(Ψ)


this yields the posterior mode Ψ
b

2. draw from a stand-in distribution h(Ψ; θ)


should have fatter tails than posterior

3. accept/reject based on probability q(Ψi+1 |Ψi )


Metropolis vs. Metropolis-Hastings specification

4. go back to 2
adjust (random walk variant) stand-in distribution
do not adjust (independence variant) stand-in distribution
Sedláček Monash Macro
Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Let’s see if we understand


Where in the MCMC algorithm do you need to

compute the steady state of your model?


solve the model?
use the Kalman filter?

In empirical macro (VARs) researchers often use conjugate priors

then it is easy to evaluate the posterior


either directly with MC integration
or very often with Gibbs sampling

are structural macro researchers too thick to implement this?!


Sedláček Monash Macro
Frequentist vs. Bayesian views
Introduction Priors
How to parametrize a model Evaluating the posterior
Maximum Likelihood Importance sampling
Bayesian estimation: the basics Markov Chain Monte Carlo methods
Summary Practical issues with MH algorithm
Summary

Many many topics left

Bayesian inference
HPD intervals, Bayes’ factors
model comparisons

prior selection
“system priors”

dealing with trends in data etc.

Sedláček Monash Macro


Introduction
How to parametrize a model
Maximum Likelihood
Bayesian estimation: the basics
Summary

Summary

Sedláček Monash Macro


Introduction
How to parametrize a model
Maximum Likelihood
Bayesian estimation: the basics
Summary

What did we do?


Parametrizing DSGE models, in particular via estimation
discussion of alternatives
Maximum Likelihood estimation
Kalman filter (based on Hamilton, 1994)
DSGE models in state-space form
singularity problem
Bayesian estimation
priors
evaluating the posterior
Markov-Chain Monte-Carlo (MCMC) methods
practical issues
Sedláček Monash Macro
Introduction
How to parametrize a model
Maximum Likelihood
Bayesian estimation: the basics
Summary

What’s next?

We now have basic tools to solve and parametrize rep-agent models

move on to hetero-agent models


come with additional computational challenges
Krusell-Smith algorithm
simulation methods
accuracy checks

Sedláček Monash Macro

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy