Singular jacobian matrix

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.

Singular jacobian matrix

Postby Brigitte » Sat Jul 18, 2015 9:18 pm

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.
Attachments
dsge.mod
mod file
(21.37 KiB) Downloaded 82 times
Brigitte
 
Posts: 11
Joined: Sat Jul 18, 2015 9:01 pm

Re: Singular jacobian matrix

Postby jpfeifer » Sun Jul 19, 2015 12:41 pm

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.
------------
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: Singular jacobian matrix

Postby Brigitte » Sun Jul 19, 2015 3:02 pm

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.
Brigitte
 
Posts: 11
Joined: Sat Jul 18, 2015 9:01 pm

Re: Singular jacobian matrix

Postby jpfeifer » Sun Jul 19, 2015 3:21 pm

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.
------------
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: Singular jacobian matrix

Postby Brigitte » Sun Jul 19, 2015 4:08 pm

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)?
Brigitte
 
Posts: 11
Joined: Sat Jul 18, 2015 9:01 pm

Re: Singular jacobian matrix

Postby jpfeifer » Sun Jul 19, 2015 4:12 pm

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.
------------
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: Singular jacobian matrix

Postby Brigitte » Tue Jul 21, 2015 2:58 pm

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.
Brigitte
 
Posts: 11
Joined: Sat Jul 18, 2015 9:01 pm

Re: Singular jacobian matrix

Postby jpfeifer » Tue Jul 21, 2015 3:05 pm

Yes. See the AguiarGopinath2007.mod on my homepage.
------------
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: Singular jacobian matrix

Postby Brigitte » Tue Jul 21, 2015 3:44 pm

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)?
Brigitte
 
Posts: 11
Joined: Sat Jul 18, 2015 9:01 pm

Re: Singular jacobian matrix

Postby jpfeifer » Tue Jul 21, 2015 7:22 pm

No, that does not make a difference.
------------
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: Singular jacobian matrix

Postby jackf118 » Thu Aug 13, 2015 3:05 am

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.
Attachments
secondmodel.mod
(3.79 KiB) Downloaded 63 times
jackf118
 
Posts: 11
Joined: Wed Jun 20, 2012 2:18 am

Re: Singular jacobian matrix

Postby jpfeifer » Thu Aug 13, 2015 1:46 pm

Your model has a unit root. That gives rise to the collinearity issue. Find out whether this unit root is desired.
------------
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: Singular jacobian matrix

Postby jackf118 » Fri Aug 14, 2015 8:21 am

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.
Attachments
secondmodel_detrend.mod
(3.88 KiB) Downloaded 70 times
jackf118
 
Posts: 11
Joined: Wed Jun 20, 2012 2:18 am

Re: Singular jacobian matrix

Postby jpfeifer » Fri Aug 14, 2015 9:30 am

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.
------------
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: Singular jacobian matrix

Postby jackf118 » Sun Aug 16, 2015 3:36 pm

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.
Attachments
secondmodel_detrend.mod
(3.88 KiB) Downloaded 67 times
jackf118
 
Posts: 11
Joined: Wed Jun 20, 2012 2:18 am

Next

Return to Dynare help

Who is online

Users browsing this forum: No registered users and 8 guests