Ramsey yet again

As Dynare 4 is now the main version, this forum is now closed. Please, post
on the Dynare Help forum
Forum rules
As Dynare 4 is the current Dynare version, there forum is now close. Post new question in the Dynare Help Forum.

Ramsey yet again

Postby jrr201 » Thu Mar 26, 2009 2:35 pm

Hi,
I would like to get the example of ramsey policy running, from
http://www.dynare.org/DynareWiki/OptimalPolicy
When I run it, after it starts the matlab computing, I get the following error messages. I would be very grateful if someone could help me to get this example working - thank you in advance:

??? Error using ==> ramsey_static
Too many input arguments.

Error in ==> dynare_solve at 72
fvec = feval(func,x,varargin{:});

Error in ==> dr1 at 83
oo_.steady_state = dynare_solve('ramsey_static',oo_.steady_state,0,M_,options_,oo_,it_);

Error in ==> resol at 101
[dr,info,M_,options_,oo_] = dr1(dr,check_flag,M_,options_,oo_);

Error in ==> stoch_simul at 40
[oo_.dr, info] = resol(oo_.steady_state,0);

Error in ==> ramsey_policy at 25
info = stoch_simul(var_list);

Error in ==> ramsey at 99
ramsey_policy(var_list_);

Error in ==> dynare at 102
evalin('base',fname) ;
jrr201
 
Posts: 5
Joined: Thu Mar 26, 2009 2:22 pm

Re: Ramsey yet again

Postby StephaneAdjemian » Thu Mar 26, 2009 3:02 pm

Hi,

What is your version of Dynare? If I replace the variable inf by inflation in the example (with the last version of the preprocessor you cannot use inf as a variable name... We will fix this asap. I changed the example in the wikipage), dynare runs smoothly.

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: Ramsey yet again

Postby jrr201 » Thu Mar 26, 2009 5:29 pm

Thank you Stephane,
I have version 4.0.3.
I tried with inflation (note that on your update on the wiki you didn't change inf from the LHS of the inflation equation), but this doesn't work. I still get the same error message:

??? Error using ==> ramsey_static
Too many input arguments.

, followed by various other error messages,
Jack
jrr201
 
Posts: 5
Joined: Thu Mar 26, 2009 2:22 pm

Re: Ramsey yet again

Postby StephaneAdjemian » Thu Mar 26, 2009 5:39 pm

Ok. I will try with 4.0.3 (I tried with the snapshot version). Thanks for reporting the error on the wikipage.

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: Ramsey yet again

Postby StephaneAdjemian » Fri Mar 27, 2009 9:32 am

Hi Jack. I am not able to reproduce your bug, even using dynare 4.0.3. Can you post the output of

Code: Select all
which dynare


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: Ramsey yet again

Postby jrr201 » Fri Mar 27, 2009 10:04 am

Stephane,
Here is the output from when i ran the mod file with snapshot version 4:


Code: Select all
>> dynare ramsey
 
Configuring Dynare ...
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Fast model evaluation.
 
Starting Dynare ...
Starting preprocessing of the model file ...
Evaluating expressions...done
WARNING: can't find a numeric initial value for y, using zero
WARNING: can't find a numeric initial value for inflation, using zero
WARNING: can't find a numeric initial value for r, using zero
WARNING: can't find a numeric initial value for y_, using zero
WARNING: can't find a numeric initial value for inf_, using zero
WARNING: can't find a numeric initial value for gammarr, using zero
WARNING: can't find a numeric initial value for gammax0, using zero
WARNING: can't find a numeric initial value for gammac0, using zero
WARNING: can't find a numeric initial value for rbar, using zero
2 equation(s) found
Processing derivation ...
  Processing Order 1... done
  Processing Order 2... done
1 equation(s) found
Processing derivation ...
  Processing Order 1... done
  Processing Order 2... done
Processing outputs ...done
Preprocessing completed.
Starting Matlab computing ...

??? Error using ==> ramsey_static
Too many input arguments.

Error in ==> dynare_solve at 72
      fvec = feval(func,x,varargin{:});

Error in ==> dr1 at 85
        oo_.steady_state = dynare_solve('ramsey_static',oo_.steady_state,0,M_,options_,oo_,it_);

Error in ==> resol at 102
    [dr,info,M_,options_,oo_] = dr1(dr,check_flag,M_,options_,oo_);

Error in ==> stoch_simul at 40
  [oo_.dr, info] = resol(oo_.steady_state,0);

Error in ==> ramsey_policy at 25
  info = stoch_simul(var_list);

Error in ==> ramsey at 97
ramsey_policy(var_list_);

Error in ==> dynare at 125
evalin('base',fname) ;
jrr201
 
Posts: 5
Joined: Thu Mar 26, 2009 2:22 pm

Re: Ramsey yet again

Postby StephaneAdjemian » Fri Mar 27, 2009 11:12 am

This is weird... I guess we do not have the same mod file. Can you post your mod file?

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: Ramsey yet again

Postby jrr201 » Fri Mar 27, 2009 11:20 am

I just opened the mod file I used, and this is the code:

var y inflation r;
varexo y_ inf_;

parameters delta sigma alpha kappa gammarr gammax0 gammac0 rbar lambda1 lambda2;

delta = 0.44;
kappa = 0.18;
alpha = 0.48;
sigma = -0.06;
lambda1 = 0.5;
lambda2 = 0.1;

model(linear);
y = delta * y(-1) + (1-delta) * y(+1) + sigma *(r - inflation(+1)) + y_;
inflation = alpha * inflation(-1) + (1-alpha) * inflation(+1) + kappa*y + inf_;
end;

shocks;
var y_;
stderr 0.63;
var inf_;
stderr 0.4;
end;

planner_objective inflation^2 + lambda1*y^2 + lambda2*r^2;

ramsey_policy(planner_discount=0.95);

It should be the same as the one on the wiki.
jrr201
 
Posts: 5
Joined: Thu Mar 26, 2009 2:22 pm

Re: Ramsey yet again

Postby StephaneAdjemian » Fri Mar 27, 2009 3:14 pm

Thanks Jack. I am still unable to reproduce your problem... Even using the same mod file. I really don't understand. What are your version of matlab and your platform ?

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: Ramsey yet again

Postby jrr201 » Fri Mar 27, 2009 4:23 pm

Stephane,
Matlab 2006 on windows.
I am very grateful for your help - it is at least ueful to know that it runs. I am running it on a 2nd hand laptop, so when I get a chance I will re-format it, or use another computer.
Many thanks,
Jack
jrr201
 
Posts: 5
Joined: Thu Mar 26, 2009 2:22 pm

Re: Ramsey yet again

Postby StephaneAdjemian » Fri Mar 27, 2009 5:08 pm

Jack, To check if this a problem with the version of matlab, could you please copy/past the outcome of the version command? I need to know the exact version of your matlab. Dynare should be compatible with a matlab version released in 2006. I guess we have incidentally introduced a line of code which is incompatible with this version.

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.


Return to Dynare version 4

Who is online

Users browsing this forum: No registered users and 1 guest