Smets-Wouters(2007) and Dynare 4

Hi,

I am trying to replicate Smets-Wouters(2007), AER paper. My problem is with the marginal likelihoods. When I run the model using their given *.mode file (without computing the mode) in Dynare 3, I get the results in the paper just fine. But when I run it in Dynare 4 again using their given *.mode file, the marginal likelihood is different than the paper. Does anyone have any idea why that might be happening? Is there a difference in evaluating likelihoods in Dynare 3 and 4?

Thank you.

1 Like

Hi, How do you estimate the marginal likelihood? How big is the difference?Are you considering the Laplace asymptotic approximation or the harmonic mean estimator (based on the metropolis hastings draws)? Can you post the mod, mode and data files? The discrepancy between the two versions of Dynare may be due to a bug or a change in the likelihood routines, but I need the files to check that.

Best, Stéphane.

Hi,

I am considering the Laplace Approximation. In Dynare 4 I found it to be -935 and in Dynare 3 -923, as presented in the paper. The *.zip file below contains data, mod and mode files.

Thank you.

Burcin
smets_wouters_20041254_data.zip (370 KB)

Dear Stephane,

I figured out the problem and solved it. It was my mistake, thank you for your time.

Burcin

HI,

When I run the program “usmodel.mod” for Smets-Wouters(2007) and Dynare 4

Matlab report:

“ERROR: There are 58 equations but 40 endogenous variables!
??? Error using ==> dynare at 126
DYNARE: preprocessing failed”

How to solve it?

Thanks

XIBU

You may want to compare your code to a functioning one. Try this one:
[Syntax shock_decomposition)

Hey xibu,

You should use pound (#) sign to make sure that Dynare understands that they are not endogenous variables but parameters as function of other deep parameters.
So you should write the equations in the steady state file of Smets-Wouters, using # in the model block. But remember to remove the parameters from declaration, if you don’t Dynare will tell you that you have declared them twice. This will give you the results.

Hope this helps.

b

In Smets-WoutersAER 2007, I cannot reproduce their counterfactual in Table 6 with respect to shocks and structure (I can only reproduce the counterfactual on “policy” – that I did either by changing the mode file specific parameters, or by fixing the values of the parameters in the mod file appropriately. Am I doing the right thing, or are the authors (SW) possibly wrong in the table? (unlikely, because this is a very well written AER paper).

Thank you for any help/comment.

I read the posts regarding Smets and Wouters (2007) and dynare version 4. I am trying to replicate that paper’s result in Matlab 2010a and dynare 4.1.3, but am having the same problem. Can anyone please tell me if you have been successfully able to replicate the results in dynare 4 and what version of Matlab are you using? I could replicate the paper in older versions (6.5 and 2007a), but unfortunately I don’t have them anymore. I tried many different things. I downloaded the exact same files as uploaded at AEA webpage and also included pound (#) signs in all the steady state equations. The problem that I am facing is that the marginal likelihoods (from Laplace approximation) are not even close to that in the paper. Also, the acceptance rate (in MH algorithm) is very low, around 0.05, which wasn’t the case when I replicated the paper in older version of Matlab and dynare 3. So does the problem lie in Matlab 2010a or dynare 4? Any help will be highly appreciated!

Hi! Bruzzle!
Why in a file usmodel.mod in the measurment equations are present ctrend, but in a file of the data (usmodel_data) is no ctrend?
Sorry for my English. I’m from Russia.

[quote=“bruzzle”]Hey xibu,

You should use pound (#) sign to make sure that Dynare understands that they are not endogenous variables but parameters as function of other deep parameters.
So you should write the equations in the steady state file of Smets-Wouters, using # in the model block. But remember to remove the parameters from declaration, if you don’t Dynare will tell you that you have declared them twice. This will give you the results.

Hope this helps.

b[/quote]


Hi! Bruzzle!
Why in a file usmodel.mod in the measurment equations are present ctrend, but in a file of the data (usmodel_data) is no ctrend?
Sorry for my English. I’m from Russia.

Hi! Bruzzle!
Why in a file usmodel.mod in the measurment equations are present ctrend, but in a file of the data (usmodel_data) is no ctrend?
Sorry for my English. I’m from Russia.

Hi! Bruzzle!
Why in a file usmodel.mod in the measurment equations are present ctrend, but in a file of the data (usmodel_data) is no ctrend?
Sorry for my English. I’m from Russia.