Page 1 of 1

Smets-Wouters(2007) and Dynare 4

PostPosted: Tue May 11, 2010 9:26 am
by bruzzle
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.

Re: Smets-Wouters(2007) and Dynare 4

PostPosted: Thu May 13, 2010 9:14 am
by StephaneAdjemian
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.

Re: Smets-Wouters(2007) and Dynare 4

PostPosted: Sat May 15, 2010 10:00 am
by bruzzle
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

Re: Smets-Wouters(2007) and Dynare 4

PostPosted: Sun May 16, 2010 8:18 pm
by bruzzle
Dear Stephane,

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

Burcin

Re: Smets-Wouters(2007) and Dynare 4

PostPosted: Thu May 20, 2010 2:05 pm
by xibu
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

Re: Smets-Wouters(2007) and Dynare 4

PostPosted: Fri May 21, 2010 7:10 am
by jpfeifer
You may want to compare your code to a functioning one. Try this one:
http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=2588

Re: Smets-Wouters(2007) and Dynare 4

PostPosted: Sat May 22, 2010 10:53 am
by 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

Re: Smets-Wouters(2007) and Dynare 4

PostPosted: Fri Sep 10, 2010 11:27 am
by Pert
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.

Re: Smets-Wouters(2007) and Dynare 4

PostPosted: Wed Apr 27, 2011 4:49 pm
by ayaj81
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!

Re: Smets-Wouters(2007) and Dynare 4

PostPosted: Wed Dec 28, 2011 6:23 am
by Leonid
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.

Re: Smets-Wouters(2007) and Dynare 4

PostPosted: Wed Dec 28, 2011 6:24 am
by Leonid
bruzzle wrote: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

--------------------------------------
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.

Re: Smets-Wouters(2007) and Dynare 4

PostPosted: Wed Dec 28, 2011 6:25 am
by Leonid
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.

Bruzzle

PostPosted: Wed Dec 28, 2011 7:39 am
by Leonid
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.