ECON 836: Empirical Macroeconomics

Syllabus

Homework 3 data

 

The code provided here may be freely copied and distributed for non-profit educational use. They may not be sold or used for commercial purposes.

MATLAB Example Programs

The Matlab code below refers to a one sector RBC model with 2 shocks as described in this PDF file.

 

Solving a DSGE model

Click here for a zip file with Matlab code to find the solution to a log-linearized version of the above model.

Note:    Install all files in one directory, then call the file main.m from the Matlab prompt.

Note:    The solution uses Paul Klein’s (2000, JEDC) matlab code to solve the set of linear difference equations. It also  calls procedures

written by Chris Sims to do the QZ matrix re-ordering. Please be careful to cite original sources if you use this in your work.

Click here for Dynare code to replicate the above Matlab code

Note: To learn more about Dynare, click here.

 

Detrending Data

Click here for a zip file with Matlab code to HP filter, Band Pass Filter, first difference, and Linearly Detrend time series data

Note: The file main detrends and plots graphs of detrended output, consumption, investment and employment

 

Maximum Likelihood Estimation of a DSGE model

Click here for a zip file with Matlab code to find the maximum likelihood estimate of the parameters of the above model.

Note:    Install all files in one directory, then call the file main.m from the Matlab prompt.

Note:    The optimization uses csminwel, written by Chris Sims.

 

Bayesian Estimation of a DSGE model

Click here for a zip file with Matlab code to sample from the posterior of the parameters of the above model.

Note:    Install all files in one directory, then call the file main.m from the Matlab prompt.

 

GAUSS Example Programs

 

Approximate an AR(p) process with a discrete Markov process using Tauchen's (1986) procedure

tauchen4.prg    (gauss version)

 

Solve for the returns in an asset pricing model when dividends follow a Markov process

aprices.prg   (gauss version)

 

Solve a DSGE model by linear quadratic approximation

lqrbc.prg (gauss version)

 

Gauss Code to solve a linearized DSGE using the Schur Matrix decomposition

            Details of one Shock RBC Model (to be added)

rbc1.prg (Solves RBC model)

rbc1.prg uses the following procedure:

solve.src (This program was written by Paul Klein at Western Ontario, called by rbc1.prg)

psztgsen.prc (This procedure by Paul Soderlind should be included in your main program)

psztgsen.dll (This file should be placed in the dlib subdirectory of Gauss)

 

Gauss code for Maximum Likelihood estimation of one shock DSGE model

innov.prg (Kalman Filter routine to evalute likelihood function)

mlest.prg (Main estimation program, calls other programs)

rbc.prg (Solves RBC model given parameter set, this is a modified version of rbc1.prg)

levhp.txt (Some data, contents decsribed in rbc.prg)

 

Gauss code for Bayesian Estimation of the one shock DSGE model using Markov Chain Monte Carlo Methods

mcmcRBC.zip (there are a number of files)

 

An Implementation of Mark Watson's (1993 JPE) "Measures of Fit for Calibrated Models"

The 'fit' programs are from Mark Watson's website. The files in this zip file appy his method to the model in my

"On Measuring the Welfare Cost of Business Cycles" paper (JME, February 2001).

mfit.zip

 

return to my homepage