Page 1 of 1

Ireland JEDC 2004 replication program

Posted: Mon Jun 29, 2009 12:16 pm
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.