Page 1 of 1

help with a code

PostPosted: Wed Jul 18, 2012 11:29 pm
by chia
Hello everybody,

Is there anybody who can help me please?I am trying to run the code I attach which is a baseline version of the BGG, and I get the following error message:


??? Error using ==> print_info at 36
The generalized Schur (QZ) decomposition failed. For more information, see the
documentation for Lapack function dgges: info=17, n=17

Error in ==> check at 51
print_info(info, options_.noprint);

Error in ==> baseline_code at 335
check;

Error in ==> dynare at 120
evalin('base',fname) ;


Thank you very much!

Re: help with a code

PostPosted: Fri Jul 20, 2012 7:07 am
by jpfeifer
AS Dynare says:
Warning: Some of the parameters have no value (zbar, rkbar, CebarK, CbarY, IbarY, YbarK,
kss, CebarY) when using steady. If these parameters are not initialized in a steadystate
file, Dynare may not be able to solve the model...

You did not define rkbar and hence all subsequent parameters depending on this cannot be initialized.

Re: help with a code

PostPosted: Fri Jul 20, 2012 2:01 pm
by chia
Thank you very much for your reply. Indeed I don't think I understand it, cause I provided numerical values for these variables...so what it resulted that they were undefined?Sorry for asking silly questions, but I am quite a starter with Dynare..

anyhow, I was finally able to fix the problem. Though a new one emerged. The code I attach is an extension of the one above. It works perfectly for the separable utility case and the separable with habits, but not when I use non- sep utility fct. In fact I get:

??? Error using ==> print_info at 36
The generalized Schur (QZ) decomposition failed. For more information, see the
documentation for Lapack function dgges: info=28, n=28

Error in ==> check at 51
print_info(info, options_.noprint);

Error in ==> baseline_code at 449
check;

Error in ==> dynare at 120
evalin('base',fname) ;

though without the warning message you rightly highlighted me above, so I think it is not the same problem. I don't see why it happens, as I just change the consumption problem and add the coupled parameters (CI EL theta) for the non sep case. Could you help me by chance?

Thank you very much for your patience!

Re: help with a code

PostPosted: Fri Jul 20, 2012 5:04 pm
by jpfeifer
Look, the parameter declarations are evaluated in the exact order you enter them. Your first lines read
Code: Select all
CI= (csigma*Cbar)/(Cbar-psi*lhbar^theta);
EL= (csigma*psi*theta*lhbar^theta)/(Cbar-psi*lhbar^theta);
theta= 2;


CI uses theta, but you only define theta two lines later. Hence, Dynare again warns that
Warning: Some of the parameters have no value (CI, EL) when using steady. If these parameters are not
initialized in a steadystate file, Dynare may not be able to solve the model...

Re: help with a code

PostPosted: Sun Jul 22, 2012 2:29 pm
by chia
Thank you very much, indeed I did not know they should be in order, I am really a beginner! Still, even if I change the order, the problem persists...I saw somewhere in this forum that you suggested to use the command model_diagnostics(M_,options_,oo_) to have more insights on the problem of the code. It tells me

Warning: Matrix is singular to working precision.
> In model_diagnostics at 115
??? Error using ==> svd
Input to SVD must not contain NaN or Inf.

Error in ==> rank at 15
s = svd(A);

Error in ==> model_diagnostics at 137
rank_jacob = rank(jacob);

How to deal with matrix singularity?Is it just a matter of calibration?though I tried to change it in several ways and the problem persists....

Thank you in advance for your suggestion and availability!

Re: help with a code

PostPosted: Mon Jul 23, 2012 6:40 am
by jpfeifer
Your steady state cannot be computed. Always put steady before check! The problem is
Code: Select all
lambdaf+wf=pref-CI^cf+EL*lhf+theta*lhf-lhf;

cf is 0 in steady state meaning that CI^cf is 1, but the LHS is 0.

Re: help with a code

PostPosted: Mon Jul 23, 2012 3:21 pm
by chia
thank you!indeed it was a mistake that I didn't notice since it should have been CI*cf! thank you very much!

Re: help with a code

PostPosted: Tue Dec 25, 2012 1:38 am
by leelane
In fact, the problem is not solved. The error is like this:
Error using print_info (line 40)
Blanchard Kahn conditions are not satisfied: no stable equilibrium

Error in stoch_simul (line 71)
print_info(info, options_.noprint);

Error in baseline_code (line 467)
info = stoch_simul(var_list_);

Error in dynare (line 120)
evalin('base',fname) ;