# Ramsey yet again

**URL:** <https://forum.dynare.org/t/ramsey-yet-again/986>\
**Category:** Dynare v4 (legacy)\
**Created:** [26 March 2009 14:35 UTC](https://forum.dynare.org/t/ramsey-yet-again/986 "2009-03-26T14:35:07Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrr201](https://forum.dynare.org/letter_avatar_proxy/v4/letter/j/58956e/32.png) [@jrr201](https://forum.dynare.org/u/jrr201)\
**Post date:** [26 March 2009 14:35 UTC](https://forum.dynare.org/t/ramsey-yet-again/986/1 "2009-03-26T14:35:07Z")

</div>

Hi,  
I would like to get the example of ramsey policy running, from  
[dynare.org/DynareWiki/OptimalPolicy](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) ;

---

<div class="post-metadata">

**Author:** ![stepan-a](https://forum.dynare.org/user_avatar/forum.dynare.org/stepan-a/32/6652_2.png) [@stepan-a](https://forum.dynare.org/u/stepan-a)\
**Post date:** [26 March 2009 15:02 UTC](https://forum.dynare.org/t/ramsey-yet-again/986/2 "2009-03-26T15:02:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jrr201](https://forum.dynare.org/letter_avatar_proxy/v4/letter/j/58956e/32.png) [@jrr201](https://forum.dynare.org/u/jrr201)\
**Post date:** [26 March 2009 17:29 UTC](https://forum.dynare.org/t/ramsey-yet-again/986/3 "2009-03-26T17:29:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![stepan-a](https://forum.dynare.org/user_avatar/forum.dynare.org/stepan-a/32/6652_2.png) [@stepan-a](https://forum.dynare.org/u/stepan-a)\
**Post date:** [26 March 2009 17:39 UTC](https://forum.dynare.org/t/ramsey-yet-again/986/4 "2009-03-26T17:39:53Z")

</div>

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

Stéphane.

---

<div class="post-metadata">

**Author:** ![stepan-a](https://forum.dynare.org/user_avatar/forum.dynare.org/stepan-a/32/6652_2.png) [@stepan-a](https://forum.dynare.org/u/stepan-a)\
**Post date:** [27 March 2009 09:32 UTC](https://forum.dynare.org/t/ramsey-yet-again/986/5 "2009-03-27T09:32:38Z")

</div>

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

```auto
which dynare
```

Best, Stéphane.

---

<div class="post-metadata">

**Author:** ![jrr201](https://forum.dynare.org/letter_avatar_proxy/v4/letter/j/58956e/32.png) [@jrr201](https://forum.dynare.org/u/jrr201)\
**Post date:** [27 March 2009 10:04 UTC](https://forum.dynare.org/t/ramsey-yet-again/986/6 "2009-03-27T10:04:11Z")

</div>

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

```auto
>> 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) ;
```

---

<div class="post-metadata">

**Author:** ![stepan-a](https://forum.dynare.org/user_avatar/forum.dynare.org/stepan-a/32/6652_2.png) [@stepan-a](https://forum.dynare.org/u/stepan-a)\
**Post date:** [27 March 2009 11:12 UTC](https://forum.dynare.org/t/ramsey-yet-again/986/7 "2009-03-27T11:12:23Z")

</div>

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

Stéphane.

---

<div class="post-metadata">

**Author:** ![jrr201](https://forum.dynare.org/letter_avatar_proxy/v4/letter/j/58956e/32.png) [@jrr201](https://forum.dynare.org/u/jrr201)\
**Post date:** [27 March 2009 11:20 UTC](https://forum.dynare.org/t/ramsey-yet-again/986/8 "2009-03-27T11:20:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![stepan-a](https://forum.dynare.org/user_avatar/forum.dynare.org/stepan-a/32/6652_2.png) [@stepan-a](https://forum.dynare.org/u/stepan-a)\
**Post date:** [27 March 2009 15:14 UTC](https://forum.dynare.org/t/ramsey-yet-again/986/9 "2009-03-27T15:14:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jrr201](https://forum.dynare.org/letter_avatar_proxy/v4/letter/j/58956e/32.png) [@jrr201](https://forum.dynare.org/u/jrr201)\
**Post date:** [27 March 2009 16:23 UTC](https://forum.dynare.org/t/ramsey-yet-again/986/10 "2009-03-27T16:23:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![stepan-a](https://forum.dynare.org/user_avatar/forum.dynare.org/stepan-a/32/6652_2.png) [@stepan-a](https://forum.dynare.org/u/stepan-a)\
**Post date:** [27 March 2009 17:08 UTC](https://forum.dynare.org/t/ramsey-yet-again/986/11 "2009-03-27T17:08:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [24 July 2017 13:28 UTC](https://forum.dynare.org/t/ramsey-yet-again/986/12 "2017-07-24T13:28:59Z")

</div>



---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [24 July 2017 13:29 UTC](https://forum.dynare.org/t/ramsey-yet-again/986/13 "2017-07-24T13:29:46Z")

</div>


