Jpfeifer code for Smets/Wouters (2007)

Dear all
Hi, I am using Dynare 4.3 version now. I want to replicate the model of Smets and Wouters(2007) . In table 2, the marginal likelihood of DSGE model is -905.8. AND jpfeifer explained it in one topic that it is as the difference between the marginal data density from the full sample minus the one of the training sample: -1166.524959-(-260.677257)= -905.8477. But I run the code from JohannesPfeifer’s website and I find the Log data density [Laplace approximation] is -1571.472030 .It have
a large difference from -1166.524959. Is there something wrong? Does -1166.524959 refer to the Log data density [Laplace approximation] for the full data?

Have you checked the respective samples? I relied on the SW 2007 replication code, which has the sample and the mode-file set to a different case than the baseline.

1 Like

Thanks a lot, professor. I have check the datafile and find that they are both the same。 AND I find that in SW2007 replication code the first_obs is 71 while your code is 1. The data has 230 samples. I thought that the full sample 1966:1-2004:4 corresponding the first_obs 71.At this time the Log data density [Laplace approximation] is -923.052692. It is similar to -905.8. First question: whether the result -905 in SW paper corresponding to the Log data density for sample 1966:1-2004:4?
Second one : for the mode file . It refer to the file containing previous value for the mode. I wonder where do they come from? In SW2007 the mode file.xparam1 equal to the posterior mode.

You need to use the respective mode-files for the respective samples to replicate the results. They are available at the AER’s homepage.