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 [Syntax shock_decomposition). 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. usmodel_mode.zip (7.94 KB) Smets_Wouters_2007_Dynare425.zip (22.2 KB) inverse_gamma_specification.m (5.14 KB)

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.

[quote=“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 [Syntax shock_decomposition). 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.[/quote]

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.

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*

[quote=“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*

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_);

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 for your answer. I have tried to run in Mathlab the us_model file too, by writing dynare us_model, as suggested, but the result was similar, as described bellow:
*.mod not found.
Error using dynare (line 117)
dynare:: can’t open us_model.mod
Can you, please, help me with a suggestion regarding the cause of the occurred error?

I have a question regarding the way to calibrate the parameters in Smets&Wouters (2007) DSGE model.
I have tried to apply the mod file, by using the observable variables from my country’s economy. As a result, the initial values of the parameters should be changed.
The error that occurred in Dynare was the one described above.
Can you, please, help me, by telling me how can I choose the initial values of parameters, taking into account the error message from Dynare 4.4.0?

Thanks a lot for your support and have a nice day!

Description of error occurred in Dynare
POSTERIOR KERNEL OPTIMIZATION PROBLEM!
(minus) the hessian matrix at the “mode” is not positive definite!
=> posterior variance of the estimated parameters are not positive.
You should try to change the initial values of the parameters using
the estimated_params_init block, or use another optimization routine.
Warning: The results below are most likely wrong!

In dynare_estimation_1 at 711
In dynare_estimation at 84
In eu71 at 504
In dynare at 162

It seems you require extended runs of mode_compute=6 or 9 or even an extended combination of the two. But foremost, make sure your data matches the model, i.e. is in the right form for the observation equation including potential demeaning and seasonal adjustment.