Page 1 of 1

dyn_risky_steadystate_solver

PostPosted: Thu Oct 03, 2013 11:53 am
by ripatti
Dear Musketeers,

Dynare library contains file dyn_risky_steadystate_solver.m, ie dynare will be away to calculate the risky steady state (or currently has an undocumented feature). In addition, there is the option options_.risky_steadystate that seems to be boolean. I could not resist temptation in setting this option to 1. It results a crash. I just wonder if somebody from the dev team could post an example how to obtain the risky steady state.

Best,
Antti

Re: dyn_risky_steadystate_solver

PostPosted: Thu Oct 03, 2013 1:44 pm
by jpfeifer
There are test-files that run with the curent snapshot at
https://github.com/DynareTeam/dynare/tree/master/tests/risky_ss

Re: dyn_risky_steadystate_solver

PostPosted: Thu Oct 03, 2013 2:38 pm
by ripatti
Thanks for the link!

I tried the last file with the curren dynare. There is interesting error message by Matlab
Code: Select all
At compilation, "hessian" was determined to be a variable and
this
 variable is uninitialized.  "hessian" is also a function name
 and previous versions of MATLAB would have called the
 function.
 However, MATLAB 7 forbids the use of the same name in the
 same
 context as both a function and a variable.

Error in dyn_risky_steadystate_solver>risky_residuals_k_order
(line 513)
    resid =
    resid1+0.5*(d1(:,dr.i_fwrd_f)*guu(dr.i_fwrd_g,:)+hessian(:,dr.i_fwrd2_f)*kron(gu1,gu1))*vec(M.Sigma_e);
   


It seems that the test files do not work in 1 and 2 Oct 2013 unstable versions. First, I must delete USE_DLL option. Then the resulting error message is the following
Code: Select all
Undefined variable dr_np.

Error in dyn_risky_steadystate_solver>risky_residuals_k_order
(line 325)
    gu1 = dr_np.ghu(i_fwrd_g,:);

Error in solve1 (line 56)
fvec = feval(func,x,varargin{:});
...

Should I try more distant unstable versions?

Cheers,
Antti

Re: dyn_risky_steadystate_solver

PostPosted: Thu Oct 03, 2013 3:01 pm
by jpfeifer
Seems as if I was wrong and not all of those files run. jerman98_2 for example is working. I am going to ask Michel about the current status.

Re: dyn_risky_steadystate_solver

PostPosted: Thu Oct 03, 2013 5:25 pm
by ripatti
Thanks. Indeed it does work with version 2013-10-02, but not with 4.3.3, that results the following
Code: Select all
Reference to non-existent field 'ghu'.

Error in dyn_risky_steadystate_solver>risky_residuals (line
245)
    gu1 = dr.ghu(dr.i_fwrd_g,:);

Error in csolve (line 62)
    f0=feval(FUN,x,varargin{:});

Thanks again!
Antti

Re: dyn_risky_steadystate_solver

PostPosted: Thu Oct 03, 2013 6:59 pm
by MichelJuillard
Hi Antti,

I haven't be working on it for a while. I will look into it and get back to you.

Best

Michel

Re: dyn_risky_steadystate_solver

PostPosted: Fri Oct 04, 2013 11:46 am
by ripatti
Thanks again!

I tried the risky steady state in my own model and I got it run without problems using the second order approximation. The third order results the following error message:
Code: Select all
Undefined variable dr_np.

Error in dyn_risky_steadystate_solver>risky_residuals_k_order
(line 325)
    gu1 = dr_np.ghu(i_fwrd_g,:);

Error in solve1 (line 56)
fvec = feval(func,x,varargin{:});

Error in dyn_risky_steadystate_solver (line 127)
    [ys, info] = solve1(func,ys0,1:endo_nbr,1:endo_nbr,0,1,
    options.gstep, ...

Re: dyn_risky_steadystate_solver

PostPosted: Tue Jan 20, 2015 5:37 am
by wrhee
I have a question about the test codes: *jermann.mod, *jermann-2.mod, *jermann-3.mod files. I tried to run each of them and replicate the results for the deterministic and risky steady state cases reported at page 12 in Juillard's manuscript "Local approximation of DSGE models around the risky steady state" (Oct. 20, 2011 version). However, I found that I always get the results reported under the column of the deterministic steady state case whether the code includes "options_.risky_steadystate = 1;" or not. Would anybody kindly explain to me how I could get the results reported under the column of the risky steady state?
Another question is whenever I run the code with "model(use_dll);" instead of "model;", I have the same error message reported below by ripatti. I would also appreciate it if somebody could tell me what the problem is.
Thank you in advance.
wrhee