Singular jacobian matrix

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.
dsge.mod (21.4 KB)

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.

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.

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.

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

Of course. The point is that a unit root with drift originally implies a

where |rho|>1. By detrending, you get a growth rate of the form you describe where the autocorrelation is smaller than 1.

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.

Yes. See the AguiarGopinath2007.mod on my homepage.

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

No, that does not make a difference.

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.
secondmodel.mod (3.79 KB)

Your model has a unit root. That gives rise to the collinearity issue. Find out whether this unit root is desired.

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.
secondmodel_detrend.mod (3.88 KB)

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.

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.
secondmodel_detrend.mod (3.88 KB)

Can anyone help me? Really appreciate!

Usually, this comes from a timing error in your model that gives rise to a complex eigenvalue. Particularly check the Euler equations.