Smets/Wouters (2007) in Dynare 4.2.5

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) in Dynare 4.2.5

Postby jpfeifer » Thu Apr 26, 2012 8:27 pm

Attached is a version of the Smets/Wouter (2007) model for Dynare 4.2.5. Due to a bug in Dynare 4.2.5 you need to replace the file matlab\distributions\inverse_gamma_specification.m with the attached one.

Note that this is an adapted version that fixes the problem discussed in http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=2588&p=5805#p5805. As this is a user-provided code that adapted the original Dynare 3 Smets/Wouters code from the AER homepage to Dynare 4 there is no guarantee for correctness. At first sight, the decision rules seem to be the same as in the original code. Nevertheless, please be careful. Any additional insights into the correctness of the provided code are appreciated. When looking into the correctness of the code, note that a different mode-file is used than in the AER-hompage benchmark case. The benchmark mode-file is also attached.
Attachments
usmodel_mode.zip
Original benchmark mode-file
(7.94 KiB) Downloaded 2769 times
Smets_Wouters_2007_Dynare425.zip
Smets/Wouters (2007) for Dynare 4.2.5
(22.17 KiB) Downloaded 3353 times
inverse_gamma_specification.m
File to replace inverse_gamma_specification.m in Dynare 4.2.5
(5.14 KiB) Downloaded 1725 times
------------
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) in Dynare 4.2.5

Postby Muhammad Ali Nasir » Mon May 07, 2012 2:42 pm

thanks for sharing but i got message"You did not declare endogenous variables after the estimation command.
This version of Dynare cannot estimate non linearized models!
Set "order" equal to 1."

moreover I posted question about taking data to model in dynare, nobody replied yet, could you please help me with that.

Regards
Muhammad Ali Nasir
 
Posts: 22
Joined: Wed Jan 12, 2011 9:30 am
Location: Leeds England

Re: Smets/Wouters (2007) in Dynare 4.2.5

Postby jpfeifer » Mon May 07, 2012 3:15 pm

These are only warnings to show that Dynare default options are used - which is fine in this case. They are no error messages.
------------
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) in Dynare 4.2.5

Postby Muhammad Ali Nasir » Mon May 07, 2012 6:39 pm

thanks.
Muhammad Ali Nasir
 
Posts: 22
Joined: Wed Jan 12, 2011 9:30 am
Location: Leeds England

Re: Smets/Wouters (2007) in Dynare 4.2.5

Postby wangxiang » Sat Jan 12, 2013 4:40 am

jpfeifer wrote:Attached is a version of the Smets/Wouter (2007) model for Dynare 4.2.5. Due to a bug in Dynare 4.2.5 you need to replace the file matlab\distributions\inverse_gamma_specification.m with the attached one.

Note that this is an adapted version that fixes the problem discussed in http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=2588&p=5805#p5805. As this is a user-provided code that adapted the original Dynare 3 Smets/Wouters code from the AER homepage to Dynare 4 there is no guarantee for correctness. At first sight, the decision rules seem to be the same as in the original code. Nevertheless, please be careful. Any additional insights into the correctness of the provided code are appreciated. When looking into the correctness of the code, note that a different mode-file is used than in the AER-hompage benchmark case. The benchmark mode-file is also attached.



Thank you very much for your sharing!
wangxiang
 
Posts: 6
Joined: Fri Jan 11, 2013 4:56 am

Re: Smets/Wouters (2007) in Dynare 4.2.5

Postby Dr. En Ami » Tue Jul 30, 2013 3:03 am

Why does permuting the lines
Code: Select all
csadjcost,6.3325,2,15,NORMAL_PDF,4,1.5;

and
Code: Select all
cmap,.7652,0.01,.9999,BETA_PDF,0.5,0.2;


in usmodel_shock_decomp.mod result in the following error?:

Error in computing likelihood for initial parameter values
Error using print_info (line 71)
one (many) parameter(s) do(es) not satisfy the lower bound

Error in initial_estimation_checks (line 69)
print_info(info, DynareOptions.noprint)

Error in dynare_estimation_1 (line 169)
oo_ =
initial_estimation_checks(objective_function,xparam1,dataset_,M_,estim_params_,options_,bayestopt_,oo_);

Error in dynare_estimation (line 70)
dynare_estimation_1(var_list,dname);

Error in usmodel_shock_decomp (line 418)
dynare_estimation(var_list_);

Error in dynare (line 120)
evalin('base',fname) ;
Dr. En Ami
 
Posts: 18
Joined: Sat Jul 06, 2013 11:19 pm

Re: Smets/Wouters (2007) in Dynare 4.2.5

Postby jpfeifer » Tue Jul 30, 2013 8:16 am

Because you are loading a mode-file derived from a different specification. Dynare does not know that you changed the parameter ordering when you load the mode-file from the previous run.
------------
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) in Dynare 4.2.5

Postby HouseC » Wed Nov 06, 2013 4:14 pm

Hi, I was following the modifications as the attached file. However, the error on "#usmodel_stst;" seems have not be fixed. Have I missed something? Or what should I modify the code in "usmodel.mod"(attached) to modify the following error:
ERROR: usmodel.mod:80.14: syntax error, unexpected ';', expecting EQUAL


Thanks

H
Attachments
usmodel.mod
(12.05 KiB) Downloaded 584 times
HouseC
 
Posts: 41
Joined: Fri Apr 19, 2013 3:36 am

Re: Smets/Wouters (2007) in Dynare 4.2.5

Postby HouseC » Thu Nov 07, 2013 4:24 pm

Anyone who can give some suggestion??

HouseC wrote:Hi, I was following the modifications as the attached file. However, the error on "#usmodel_stst;" seems have not be fixed. Have I missed something? Or what should I modify the code in "usmodel.mod"(attached) to modify the following error:
ERROR: usmodel.mod:80.14: syntax error, unexpected ';', expecting EQUAL


Thanks

H
HouseC
 
Posts: 41
Joined: Fri Apr 19, 2013 3:36 am

Re: Smets/Wouters (2007) in Dynare 4.2.5

Postby jpfeifer » Fri Nov 08, 2013 6:19 am

My posted file clearly shows that it must be
Code: Select all
@#include "usmodel_stst.mod"

and not
Code: Select all
#usmodel_stst;
------------
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

Smets/Wouters (2007) in Dynare 4.4.x

Postby ste_s » Thu Jan 30, 2014 6:50 pm

Hi,
I am trying to run the code in Dynare 4.4.x but I am getting the error below. It seems odd because the same code runs smoothly in Dynare 4.3.3. I wonder whether this is a bug in Dynare 4.4.
Any help greatly appreciated.

??? Undefined function or method 'strsplit' for input arguments
of type 'char'.

Error in ==> dynare_estimation_1 at 284
options_list = strsplit(options_.optim_opt,',');

Error in ==> dynare_estimation at 84
dynare_estimation_1(var_list,dname);

Error in ==> usmodel at 504
dynare_estimation(var_list_);

Error in ==> dynare at 162
evalin('base',fname) ;
ste_s
 
Posts: 4
Joined: Sat Jan 18, 2014 10:58 am

Re: Smets/Wouters (2007) in Dynare 4.2.5

Postby jpfeifer » Thu Jan 30, 2014 8:03 pm

It's a version problem. strsplit is a new Matlab function. Try using the one at http://www.mathworks.com/matlabcentral/fileexchange/21710-string-toolkits/content/strings/strsplit.m
------------
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) in Dynare 4.2.5

Postby ste_s » Thu Jan 30, 2014 8:23 pm

It does help. Thank you very much!
ste_s
 
Posts: 4
Joined: Sat Jan 18, 2014 10:58 am

Re: Smets/Wouters (2007) in Dynare 4.2.5

Postby georgiana_alina » Sat Mar 15, 2014 12:16 pm

Hello!
I tried to run the code for the model of Smets/Wouters (2007) in Dynare 4.40 and the following error occured:
*.mod not found.
Error using dynare (line 117)
dynare:: can't open inverse_gamma_specification.mod
Is that a compatibility problem caused by the version of Dynare used?

Thank you very much for your support,

Alina
georgiana_alina
 
Posts: 26
Joined: Sat Mar 08, 2014 5:39 pm

Re: Smets/Wouters (2007) in Dynare 4.2.5

Postby jpfeifer » Sun Mar 16, 2014 5:22 pm

The file you need to call is usmodel.mod. For 4.4 you don't need the inverse_gamma_specification-file. That is, use
Code: Select all
dynare usmodel_shock_decomp

not
Code: Select all
dynare inverse_gamma_specification
------------
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

Next

Return to Dynare help

Who is online

Users browsing this forum: No registered users and 8 guests