Smets&Wouters error

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 error

Postby sashe86 » Tue Apr 17, 2012 2:12 pm

Hi there,

I am trying to run the Smets and Wouters code which I downloaded from this site.

When i run the model, I get the following error;

Starting Dynare (version 4.2.5).
Starting preprocessing of the model file ...
ERROR: usmodel.mod:80.14: syntax error, unexpected ';', expecting EQUAL

??? Error using ==> dynare at 114
DYNARE: preprocessing failed

I've had a look through the code, but I'm not sure what needed to be amended?

Any ideas?

S
sashe86
 
Posts: 24
Joined: Tue Apr 03, 2012 4:14 pm

Re: Smets&Wouters error

Postby kyri82 » Tue Apr 17, 2012 3:28 pm

Check line 80, where the command ends. Or better, check if actually the command in line 79 ends with a ";"
kyri82
 
Posts: 141
Joined: Thu Feb 10, 2011 6:14 pm
Location: Toulouse - France

Re: Smets&Wouters error

Postby sashe86 » Tue Apr 17, 2012 3:37 pm

Hi kyri82,

Yes, at line 80, there is a ';' - I have removed the ';' and re-ran the model and then get this error:

Starting Dynare (version 4.2.5).
Starting preprocessing of the model file ...
ERROR: usmodel.mod:84.8: syntax error, unexpected INT_NUMBER, expecting EQUAL

When I change it to an equal (which doesn't really make sense to me), I get this error:

tarting Dynare (version 4.2.5).
Starting preprocessing of the model file ...
ERROR: usmodel.mod:84.28: syntax error, unexpected EQUAL

??? Error using ==> dynare at 114
DYNARE: preprocessing failed

So, I wonder what it could be?
sashe86
 
Posts: 24
Joined: Tue Apr 03, 2012 4:14 pm

Re: Smets&Wouters error

Postby kyri82 » Tue Apr 17, 2012 3:39 pm

Can you send me the file? The original one, with the first error message.
kyri82
 
Posts: 141
Joined: Thu Feb 10, 2011 6:14 pm
Location: Toulouse - France

Re: Smets&Wouters error

Postby sashe86 » Tue Apr 17, 2012 3:50 pm

The .mod file I'm using is attached.

Thanks for the help!

S
Attachments
usmodel.mod
(12.05 KiB) Downloaded 173 times
sashe86
 
Posts: 24
Joined: Tue Apr 03, 2012 4:14 pm

Re: Smets&Wouters error

Postby kyri82 » Tue Apr 17, 2012 3:59 pm

What does this command do? #usmodel_stst;
And why does it appear in the model block?
kyri82
 
Posts: 141
Joined: Thu Feb 10, 2011 6:14 pm
Location: Toulouse - France

Re: Smets&Wouters error

Postby bkjecn » Tue Apr 17, 2012 4:49 pm

Any command in the model section of the form

#varname = expression ;

is a model local variable. Those are documented here: http://www.dynare.org/manual/index_15.h ... eclaration

Just delete that line since it isn't of the correct form in your file and then change the inv_gamma_pdf priors to inv_gamma2_pdf priors. The problem is that you are giving it values that it cannot use to solve for the hyperparameters. I did it in the attached file and it worked. You will next need a file for the data named usmodel_data. You didn't post that so I am not sure if you have it or from where to get it. It might be on whichever site you used to download the mod file.
Attachments
usmodel.mod
(12.04 KiB) Downloaded 215 times
bkjecn
 
Posts: 35
Joined: Thu Oct 13, 2011 3:02 am

Re: Smets&Wouters error

Postby sashe86 » Tue Apr 17, 2012 5:01 pm

@bkjecn,

Thanks, that solved the problem, really appreciate your help. Same to you @kyri82.

S
sashe86
 
Posts: 24
Joined: Tue Apr 03, 2012 4:14 pm

Re: Smets&Wouters error

Postby jpfeifer » Thu Apr 19, 2012 6:42 am

The original Smets/Wouters code was written for Dynare 3. What #usmodel_stst did is call a Matlab function that computed some of the parameters. You should not simply delete it. Note that there is a functioning version of the Smets/Wouters Model for Dynare 4 in the forum: http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=2588&p=5805#p5805
------------
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 error

Postby sashe86 » Thu Apr 26, 2012 5:02 pm

jpfeifer wrote:The original Smets/Wouters code was written for Dynare 3. What #usmodel_stst did is call a Matlab function that computed some of the parameters. You should not simply delete it. Note that there is a functioning version of the Smets/Wouters Model for Dynare 4 in the forum: http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=2588&p=5805#p5805



Hi jpfeifer ,

Just seeing your response now. I agree. It doesn't seem sensible to simple delete a line of code. I had a look at the functioning version of the SW model for Dynare 4 which you are referring to. Unfortunately, I seem to be getting an error when I run it:


Starting Dynare (version 4.2.5).
Starting preprocessing of the model file ...
ERROR: usmodel_shock_decomp.mod:186.21-26: syntax error, unexpected NAME, expecting PARAMETER_SET

??? Error using ==> dynare at 114
DYNARE: preprocessing failed

When I remove the line at 186 relating to the shock composition, I then get this error:

You did not declare endogenous variables after the estimation command.
This version of Dynare cannot estimate non linearized models!
Set "order" equal to 1.

??? Error using ==> inverse_gamma_specification at 121
inverse_gamma_specification:: Failed in solving for the hyperparameters!

Error in ==> set_prior at 224
[bayestopt_.p6(k(i)),bayestopt_.p7(k(i))] = ...

Error in ==> dynare_estimation_init at 124
[xparam1,estim_params_,bayestopt_,lb,ub,M_] = set_prior(estim_params_,M_,options_);

Error in ==> dynare_estimation_1 at 37
[data,rawdata,xparam1] = dynare_estimation_init(var_list_);

Error in ==> dynare_estimation at 62
dynare_estimation_1(var_list,varargin{:});

Error in ==> usmodel_shock_decomp at 412
dynare_estimation(var_list_);

Error in ==> dynare at 120
evalin('base',fname) ;
sashe86
 
Posts: 24
Joined: Tue Apr 03, 2012 4:14 pm

Re: Smets&Wouters error

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

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


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 5 guests