Dear Johannes,
thank you very much for your rapid answer!
I use Dynare version 4.4.3. and MATLAB Version 7.12.0.635 (R2011a)
Please find below (and in attachment) a simple .mod file that illustrates the problem in using resol with third order.
See last lines of the file:
"stoch_simul(periods=0,order=3,pruning,noprint,nograph,nocorr,nofunctions,nomoments,IRF=0);
set_param_value('ALP',.5);
[oo2_.dr,info2,M2_,options2_,oo2_] = resol(0,M_,options_,oo_); "
When I set order=2 in stoch_simul, then resol works correctly!
But for order=3 I get the following error message
---
??? Undefined function or variable "jacobia_".
Error in ==> stochastic_solvers at 118
[infrow,infcol]=find(isinf(jacobia_));
Error in ==> resol at 137
[dr,info] = stochastic_solvers(dr,check_flag,M,options,oo);
Error in ==> MODEL_RBC_TEST at 180
[oo2_.dr,info2,M2_,options2_,oo2_] = resol(0,M_,options_,oo_);
Error in ==> dynare at 180
evalin('base',fname) ;
----
I it tried putting "options_.qz_criterium = 1+1e-6;" before stoch_simul, but this still led to the same error.
So, I guess that "options_.qz_criterium = 1+1e-6;" has to be inserted somewhere in resol.m or in k_order_pert, or somewhere els?
Could you please tell me exactly where the change has to be made?
I am reluctant to changing these files without your advice, as this might lead to other problems.
If explainig/making the changes is too complicated, perhaps you could simply post (or send me) your correct version of resol?
It would also be great if this issue could be fixed in the next Dynare release.
Thank you very much to you and your colleagues in the Dynare team for the great work!
And thank you very much for your further feedback!
Best regards, Robert
========================================================================================================
ATTACHED FILE: MODEL_RBC_TEST.mod
//
robert_kollmann@yahoo.com// c:\dynare\workEZW\MODEL_RBC_TEST.mod Jan21 2015
// Simple RBC model with shocks to: TFP (th), Gov't purchases (g) and time preference (lam)
// u=(1/(1-RISKAV)) * C^(1-RISKAV) - MU * (1/(1+1/ELS))*lab^(1+1/ELS)
// ELS: labor supply elasticity. y=th*(kap^(1-ALP))*(lab^ALP);
// Normalization: set THss & MU such that in steady state y=lab=1
// Express variables in logs: Ly is log(GDP) etc.
var Ly Lc Linvest Llab Lkap Lth Lg Llam;
varexo Eth Eg Elam;
parameters ALP DEPREC BETTA RISKAV ELS Gss RHOth RHOg RHOlam SSth SSg SSlam;
ALP=.7; DEPREC=.025; BETTA=0.99; Gss=.2; RISKAV=10; ELS=4; RHOth=.99;
RHOg=.99; RHOlam=.99; SSth=.10; SSg=.05; SSlam=.0025;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
model;
exp(Ly)=exp(Lth)*(exp(Llab)^ALP)*(exp(Lkap(-1))^(1-ALP));
exp(Lkap)=exp(Lkap(-1))*(1-DEPREC)+exp(Linvest);
# Kss=(1-ALP)/(DEPREC+(1-BETTA)/BETTA);
# THss=Kss^(ALP-1);
# Css=1-Gss-DEPREC*Kss;
# MU=ALP*Css^-RISKAV;
(ALP*exp(Ly)/exp(Llab))*(exp(Lc)^-RISKAV)=MU*exp(Llab)^(1/ELS);
exp(Ly)=exp(Lc)+exp(Linvest)+exp(Lg);
1=BETTA*exp(Llam)*((exp(Lc(+1))/exp(Lc))^-RISKAV)*((1-ALP)*exp(Ly(+1))/exp(Lkap) + 1-DEPREC);
Lth-log(THss)=RHOth*(Lth(-1)-log(THss)) + SSth*Eth;
Lg-log(Gss)=RHOg*(Lg(-1)-log(Gss)) + SSg*Eg;
Llam=RHOlam*Llam(-1) + SSlam*Elam;
end;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
steady_state_model;
Ly=0;
Lkap=log((1-ALP)/(DEPREC+(1-BETTA)/BETTA));
Lg=log(Gss);
Lc=log(1-exp(Lg)-DEPREC*exp(Lkap));
Linvest=log(DEPREC*exp(Lkap));
Llab=0;
Lth=log(exp(Lkap)^(ALP-1));
Llam=0;
end;
//steady;
//check;
//model_diagnostics;
shocks;
var Eth = 1;
var Eg = 1;
var Elam = 1;
end;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//options_.qz_criterium = 1+1e-6
stoch_simul(periods=0,order=3,pruning,noprint,nograph,nocorr,nofunctions,nomoments,IRF=0);
//options_.qz_criterium = 1+1e-6
set_param_value('ALP',.5);
[oo2_.dr,info2,M2_,options2_,oo2_] = resol(0,M_,options_,oo_);