Page 1 of 5

Smets/Wouters (2007) in Dynare 4.2.5

PostPosted: Thu Apr 26, 2012 8:27 pm
by jpfeifer
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.

Re: Smets/Wouters (2007) in Dynare 4.2.5

PostPosted: Mon May 07, 2012 2:42 pm
by Muhammad Ali Nasir
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

Re: Smets/Wouters (2007) in Dynare 4.2.5

PostPosted: Mon May 07, 2012 3:15 pm
by jpfeifer
These are only warnings to show that Dynare default options are used - which is fine in this case. They are no error messages.

Re: Smets/Wouters (2007) in Dynare 4.2.5

PostPosted: Mon May 07, 2012 6:39 pm
by Muhammad Ali Nasir
thanks.

Re: Smets/Wouters (2007) in Dynare 4.2.5

PostPosted: Sat Jan 12, 2013 4:40 am
by wangxiang
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!

Re: Smets/Wouters (2007) in Dynare 4.2.5

PostPosted: Tue Jul 30, 2013 3:03 am
by Dr. En Ami
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) ;

Re: Smets/Wouters (2007) in Dynare 4.2.5

PostPosted: Tue Jul 30, 2013 8:16 am
by jpfeifer
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.

Re: Smets/Wouters (2007) in Dynare 4.2.5

PostPosted: Wed Nov 06, 2013 4:14 pm
by HouseC
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

Re: Smets/Wouters (2007) in Dynare 4.2.5

PostPosted: Thu Nov 07, 2013 4:24 pm
by HouseC
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

Re: Smets/Wouters (2007) in Dynare 4.2.5

PostPosted: Fri Nov 08, 2013 6:19 am
by jpfeifer
My posted file clearly shows that it must be
Code: Select all
@#include "usmodel_stst.mod"

and not
Code: Select all
#usmodel_stst;

Smets/Wouters (2007) in Dynare 4.4.x

PostPosted: Thu Jan 30, 2014 6:50 pm
by ste_s
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) ;

Re: Smets/Wouters (2007) in Dynare 4.2.5

PostPosted: Thu Jan 30, 2014 8:03 pm
by jpfeifer
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

Re: Smets/Wouters (2007) in Dynare 4.2.5

PostPosted: Thu Jan 30, 2014 8:23 pm
by ste_s
It does help. Thank you very much!

Re: Smets/Wouters (2007) in Dynare 4.2.5

PostPosted: Sat Mar 15, 2014 12:16 pm
by georgiana_alina
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

Re: Smets/Wouters (2007) in Dynare 4.2.5

PostPosted: Sun Mar 16, 2014 5:22 pm
by jpfeifer
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