Help with a code

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!
baseline_code.mod (4.2 KB)

AS Dynare says:

[quote]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… [/quote]

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

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!
baseline_code.mod (6.77 KB)

Look, the parameter declarations are evaluated in the exact order you enter them. Your first lines read

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

[quote]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… [/quote]

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!
baseline_code.mod (6.89 KB)

Your steady state cannot be computed. Always put steady before check! The problem is

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.

thank you!indeed it was a mistake that I didn’t notice since it should have been CI*cf! thank you very much!

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