Smets-Wouters(2007) and Dynare 4

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Smets-Wouters(2007) and Dynare 4

Postby bruzzle » Tue May 11, 2010 9:26 am

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.
bruzzle
 
Posts: 13
Joined: Fri Apr 30, 2010 11:52 am

Re: Smets-Wouters(2007) and Dynare 4

Postby StephaneAdjemian » Thu May 13, 2010 9:14 am

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.
Stéphane Adjemian
Université du Maine, GAINS and DynareTeam
https://stepan.adjemian.eu
StephaneAdjemian
 
Posts: 429
Joined: Wed Jan 05, 2005 4:24 pm
Location: Paris, France.

Re: Smets-Wouters(2007) and Dynare 4

Postby bruzzle » Sat May 15, 2010 10:00 am

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
Attachments
smets_wouters_20041254_data.zip
(369.56 KiB) Downloaded 642 times
bruzzle
 
Posts: 13
Joined: Fri Apr 30, 2010 11:52 am

Re: Smets-Wouters(2007) and Dynare 4

Postby bruzzle » Sun May 16, 2010 8:18 pm

Dear Stephane,

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

Burcin
bruzzle
 
Posts: 13
Joined: Fri Apr 30, 2010 11:52 am

Re: Smets-Wouters(2007) and Dynare 4

Postby xibu » Thu May 20, 2010 2:05 pm

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
xibu
 
Posts: 4
Joined: Sun Mar 28, 2010 11:51 pm

Re: Smets-Wouters(2007) and Dynare 4

Postby jpfeifer » Fri May 21, 2010 7:10 am

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
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Smets-Wouters(2007) and Dynare 4

Postby bruzzle » Sat May 22, 2010 10:53 am

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
bruzzle
 
Posts: 13
Joined: Fri Apr 30, 2010 11:52 am

Re: Smets-Wouters(2007) and Dynare 4

Postby Pert » Fri Sep 10, 2010 11:27 am

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.
Pert
 
Posts: 14
Joined: Thu Dec 03, 2009 8:54 am

Re: Smets-Wouters(2007) and Dynare 4

Postby ayaj81 » Wed Apr 27, 2011 4:49 pm

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!
ayaj81
 
Posts: 1
Joined: Fri Apr 08, 2011 10:36 pm

Re: Smets-Wouters(2007) and Dynare 4

Postby Leonid » Wed Dec 28, 2011 6:23 am

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.
Leonid
 
Posts: 6
Joined: Wed Dec 28, 2011 4:12 am

Re: Smets-Wouters(2007) and Dynare 4

Postby Leonid » Wed Dec 28, 2011 6:24 am

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.
Leonid
 
Posts: 6
Joined: Wed Dec 28, 2011 4:12 am

Re: Smets-Wouters(2007) and Dynare 4

Postby Leonid » Wed Dec 28, 2011 6:25 am

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.
Leonid
 
Posts: 6
Joined: Wed Dec 28, 2011 4:12 am

Bruzzle

Postby Leonid » Wed Dec 28, 2011 7:39 am

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.
Leonid
 
Posts: 6
Joined: Wed Dec 28, 2011 4:12 am


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 10 guests