Page 1 of 1
Matrix singularity
Posted:
Mon Jul 09, 2012 5:54 pm
by DJINKPO
Hello! Evreyone!
I did estimation of my model (stochastic) and I got the message bellow. Could anybody help me solve it? I don't know how to cope with matrix singularity problem in my model.
Any suggestion is welcome. Thanks
Warning: Matrix is close to singular or badly scaled.
Results may be inaccurate. RCOND = 1.998226e-037.
> In evaluate_steady_state at 76
In resol at 108
In check at 71
In Gambia33 at 379
In dynare at 120
??? Error using ==> print_info at 49
The Jacobian matrix evaluated at the steady state contains elements that are not real or are infinite
Error in ==> check at 76
print_info(info, options.noprint);
Error in ==> Gambia33 at 379
check(M_,options_,oo_);
Error in ==> dynare at 120
evalin('base',fname) ;
Re: Matrix singularity
Posted:
Tue Jul 10, 2012 4:50 pm
by kyri82
If this is a calibrated model, make sure that you set the parametres correctly.
Re: Matrix singularity
Posted:
Tue Jul 10, 2012 6:00 pm
by DJINKPO
Hello!
I did not get your reply right. How can I make sure to have set the parameters correctly? Do you have any tips on this issue? Please help me by giving more detail. With the same values for the parameters, it goes well. But when I add one more equation (thus one endogenous) I got the message.
Best regards
Re: Matrix singularity
Posted:
Tue Jul 10, 2012 6:11 pm
by kyri82
I guess that that means that this additional equation is creating some linear dependencies. What is it exactly? Can you describe a bit your model, and send me your file?
K.
Re: Matrix singularity
Posted:
Tue Jul 10, 2012 6:30 pm
by DJINKPO
This additional equation is the open-market rule implemented by the central bank as an instrument to control money supply.
Here is the .mod file.
Re: Matrix singularity
Posted:
Wed Jul 11, 2012 8:13 am
by kyri82
Hi and sorry for the delay. I did not manage to solve the problem but I have a couple of comments for you. First, your problem the initial values that you provide (considering that the model is well specified and correctly put in the code). That means that the initial values are far from the steady-state ones so that Dynare does not manage to reach them with the max number of iterations it does. If indeed this is the problem, it is not a big deal and the only way to solve it is to try with different initial conditions. However, there is no guidance for this, unless you have an idea about the actual values at steady-state. The only thing you can do is with trial and error, try to modify some initial conditions and see if it gets you somewhere. However, considering the dimensionality of your model this can take you forever. Otherwise, my advise to you is to solve the steady-state by hand and either provide the actual steady-state values as initial ones, or you log-linearise your model and put it as such on Dynare. This is what I always do, I find it much better it gives you a better view of your model.
A couple of more comments:
- you start the model block by model (linear). But if you did not put the model in log-linear form, you cannot do that right?
- The parametre gam seems to be determined as a function of other parametres of the model. In the code you have:
gam=0.709620477; //(1-bet*(1-xi))*(1-xi)/xi Output gap weight in domestic price inflation (former value=0.70;)
If indeed it is equal to the equation after "//", put it this way. Why do you calibrate it yourself to some other value?
Hope that helps. Good luck!
Re: Matrix singularity
Posted:
Wed Jul 11, 2012 9:03 am
by DJINKPO
Hello!
Thanks for your advice.
But some think remains unclear in my mind. You did mention and I quote: ".... is to solve the steady-state by hand and either provide the actual steady-state values as initial ones, or you log-linearise your model and put it as such on Dynare..."
How should I go about doing this? Could you provide me with a useful material on this issue?
Best ragards
Re: Matrix singularity
Posted:
Wed Jul 11, 2012 2:53 pm
by kyri82
Do you know how to solve and log-linearise a model? In my view, this is what you should do first before you learn computational staff. In solving RBC models we follow these steps:
1) Set out the model, the equations etc.
2) Get the first-order conditions.
3) Define the steady-state and solve it; i.e. define the values of the parametres at steady-state. These would be constants, if you assume no growth at steady-state.
4) Log-linearise the equations and the first-order conditions.
There are many references for these things, but nothing that really teaches you how to do log-linearisations. Why don't you ask a colleague, or your supervisor? I would really advice you to read the first chapter in Collard's notes:
http://fabcol.free.fr/index.php?page=notesclick on the pdf file for "Linear Economies"