Ireland JEDC 2004 replication program

Discussion of State Space and Dynamic Stochastic General Equilibrium Models
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Ireland JEDC 2004 replication program

Unread post by TomDoan »

The attached is a replication file for Ireland(2004), "A Method for Taking Models to the Data", Journal of Economic Dynamics and Control, vol 28, no. 6, 1205-1226. This estimates a DSGE model by maximum likelihood using the log-linearization and solution handled by the DSGE instruction.

The key to doing this is to use the DLM instruction with a START option, where the START option calls a function which solves the model. In this case:

Code: Select all

function SolveModel
*
* Guard against solving the model with problem values
*
if eta<1.0.or.eta>1.05.or.rho>=1.0
  return
dsge(model=dsgemodel,expand=loglinear,a=ax,f=fx,steady=steady,initial=basesteady) y c h in k a
compute afull=ax~\d,ffull=fx~\%identity(3),[symmetric] swfull=sigma^2~\%ltouterxx(lsigmav)
end SolveModel

dlm(startup=SolveModel(),y=yf,$
  a=afull,f=ffull,c=cfull,sw=swfull,presample=ergodic,$
  pmethod=simplex,piters=5,method=bfgs,iters=100,$
  reject=(eta<1.0.or.eta>1.05.or.rho>=1.0)) 1948:1 2002:2
The SolveModel function creates the matrices needed for the A, F and SW options in DLM. Ordinarily, the first two of those would just be the A and F matrices created by DSGE; in this case, however, there's a secondary state space model needed for the measurement errors (which follow a VAR(1)) so AFULL and FFULL concatenate the structural model with the measurement model.
Attachments
Ireland JEDC 2004.zip
(6.03 KiB) Downloaded 1062 times
Post Reply