Page 1 of 2
Singular jacobian matrix
Posted:
Sat Jul 18, 2015 9:18 pm
by Brigitte
Dear Dynare users and creators,
I have a problem with my dynare code. When I run the model diagnostics, it says that the Jacobian is singular. Moreover, the stoch simul is not able to calculate the theoretical moments. Usually, the problem stems from the Walras law. I closed the open economy through NFAP evolution equation and government debt equation. Further, there is a market clearing of GDP identity and production function. I can't see what is wrong. I would appreciate any suggestions. Thank you very much in advance.
Re: Singular jacobian matrix
Posted:
Sun Jul 19, 2015 12:41 pm
by jpfeifer
Your model simply has a unit root. This gives rise to the warning and is the reason some unconditional second moments are NaN. If there is a unit root, these second moments are not finite. You need to understand why the response to some shocks is permanent for some variables.
Re: Singular jacobian matrix
Posted:
Sun Jul 19, 2015 3:02 pm
by Brigitte
Dear Dr. Pfeifer,
thank you very much for your response. My model contains unit root technology shock, it drives all of the variables like consumption, gdp, investment... Could this cause this problem? However, I can't see the Inf eigenvalue after check command. Moreover, I stationarzed given variables by the unit root technology. Then I assume that tis unit root technology grows at mu_zz and this growth has a constant staedy state mu_z. The loglinearized mu_zz enters many equations. ( Similarly to Adolson 2005). I expect that shock to mu_zz will cause permanent response in the variables driven by technology. How should i solve in the model? I need to estimate the model and use it for simulation and forecasting. Thank you very much.
Re: Singular jacobian matrix
Posted:
Sun Jul 19, 2015 3:21 pm
by jpfeifer
If you correctly stationarized your model, the unit root should be gone. But it is not, suggesting that there is still a mistake somewhere. Note that a unit root is an eigenvalue of modulus 1, not Inf.
Re: Singular jacobian matrix
Posted:
Sun Jul 19, 2015 4:08 pm
by Brigitte
Thank you very much. And is it ok to assume that this unit root technology growth is in the log-linearized version defined as mu_zz=rho_muz*mu_zz(-1)+e_z, where e_z is traditional exo shock variable and rho_muz is from (0,1)?
Re: Singular jacobian matrix
Posted:
Sun Jul 19, 2015 4:12 pm
by jpfeifer
Of course. The point is that a unit root with drift originally implies a
- Code: Select all
x=rho*x(-1)+eps_x
where |rho|>1. By detrending, you get a growth rate of the form you describe where the autocorrelation is smaller than 1.
Re: Singular jacobian matrix
Posted:
Tue Jul 21, 2015 2:58 pm
by Brigitte
Thank you very much for your answers. I tried to go back and make my model smaller. Currently, I got rid of this unit root and my model is probably stationarized corectly. However, when I shock the unit root technology variable mu_zz, the effect to the variables which were stationarized disappears in time. I was wondering, if it is even possible to have model in Dynare without unit root and have a permanent response to given shock. Thank you very much in advance for an answer.
Re: Singular jacobian matrix
Posted:
Tue Jul 21, 2015 3:05 pm
by jpfeifer
Yes. See the AguiarGopinath2007.mod on my homepage.
Re: Singular jacobian matrix
Posted:
Tue Jul 21, 2015 3:44 pm
by Brigitte
Thank you very much. And probabaly a stupid question, but does it make any difference for dynare in this case if my model is linear ( loglinearized)?
Re: Singular jacobian matrix
Posted:
Tue Jul 21, 2015 7:22 pm
by jpfeifer
No, that does not make a difference.
Re: Singular jacobian matrix
Posted:
Thu Aug 13, 2015 3:05 am
by jackf118
Dear all,
I run my model with the similar "Jacobian singular" problem. The stoch simul is not able to calculate the result. I wonder if the reason is colinearity and how can I find and fix it. I would appreciate any suggestions. Thank you very much in advance.
Re: Singular jacobian matrix
Posted:
Thu Aug 13, 2015 1:46 pm
by jpfeifer
Your model has a unit root. That gives rise to the collinearity issue. Find out whether this unit root is desired.
Re: Singular jacobian matrix
Posted:
Fri Aug 14, 2015 8:21 am
by jackf118
Thank you for your kind help, Professor Pfeifer. I detrend the model and there is no unit root problem now. However, I still encountered the "Error using ones
NaN and Inf not allowed" for the original shock ("w"), which is the growth rate of the money. I think I have a similar problem as Brigitte, that I do expect that shock to w will cause permanent response in some variables. But I donot know why w has such problem. Could you please help me figure it out? thank you so much.
Re: Singular jacobian matrix
Posted:
Fri Aug 14, 2015 9:30 am
by jpfeifer
That's because you are trying to do stochastic simulations without defining a stochastic process for your exogenous variables. Rather, you have a one-time shock. That's where you usually use the simul-command. When there are no shocks, the second moments are not well-defined.
Re: Singular jacobian matrix
Posted:
Sun Aug 16, 2015 3:36 pm
by jackf118
Dear Prof. Pfeifer,
Thank you for your kind help and I have got the irf under your guidence. My follow up question is that I find the figures are zigzags. I didnot figure out why such shape appears from the intuition of my model. I wonder if there is some general explanation for the apperance of such shape. Or if it is because the inaccuracy and I need to try higher order approximation via dynare++ or some advanced technique. Thank you so much for your patience.