Replicating Smets & Wouters (2007)

Hi forum colleagues,

I am trying to replicate Smets & Wouters (2007). The author’s usmodel.mod file writes the following estimation command:
estimation(optim=(‘MaxIter’,200),datafile=usmodel_data,mode_compute=0,mode_file=usmodel_mode,first_obs=71,presample=4,lik_init=2,prefilter=0,mh_replic=0,mh_nblocks=2,mh_jscale=0.20,mh_drop=0.2);

Regarding “mode_file = usmodel_mode”, how to create the “usmodel_mode” file? Which command could I use to save previous value for the mode? Thank you very much in advance!

You can find that file at Smets/Wouters (2007) in Dynare 4.2.5 and of course in the official replication files at the AER homepage.

Thank you, professor! I found that “usmodel_mode.mat” file.

If I want to build a new model in the future and use similar code for estimation, how could I create the mat file for the new model?
I tested “dynasave(newmodel);” using smets & wouter’s script, but it reports error:
Error using dynasave (line 39)
dynasave:: The results structure does not contain simulated series. Maybe the periods option has not been set.

Your guidance and advice will be greatly appreciated!

The _mode-file is automatically created when you run mode-finding. It will be stored in the /output folder

Thank you, professor!
I opened the output folder but it is empty. Would you please guide me which command I can use to run mode-finding? I searched the dynare manual but did not find the solution.

Mode-finding only occurs if you run estimation.

Got it. Now I get the _mode.mat file. Thank you very much!