help with a code

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

help with a code

Postby chia » Wed Jul 18, 2012 11:29 pm

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!
Attachments
baseline_code.mod
(4.2 KiB) Downloaded 156 times
chia
 
Posts: 6
Joined: Wed Jul 18, 2012 10:19 pm

Re: help with a code

Postby jpfeifer » Fri Jul 20, 2012 7:07 am

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: help with a code

Postby chia » Fri Jul 20, 2012 2:01 pm

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!
Attachments
baseline_code.mod
(6.77 KiB) Downloaded 101 times
chia
 
Posts: 6
Joined: Wed Jul 18, 2012 10:19 pm

Re: help with a code

Postby jpfeifer » Fri Jul 20, 2012 5:04 pm

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...
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: help with a code

Postby chia » Sun Jul 22, 2012 2:29 pm

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!
Attachments
baseline_code.mod
(6.89 KiB) Downloaded 113 times
chia
 
Posts: 6
Joined: Wed Jul 18, 2012 10:19 pm

Re: help with a code

Postby jpfeifer » Mon Jul 23, 2012 6:40 am

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: help with a code

Postby chia » Mon Jul 23, 2012 3:21 pm

thank you!indeed it was a mistake that I didn't notice since it should have been CI*cf! thank you very much!
chia
 
Posts: 6
Joined: Wed Jul 18, 2012 10:19 pm

Re: help with a code

Postby leelane » Tue Dec 25, 2012 1:38 am

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) ;
leelane
 
Posts: 14
Joined: Fri Oct 05, 2012 7:59 am


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 4 guests