Page 1 of 1

A problem related to singularity and colinear relationships

PostPosted: Sun Mar 19, 2017 7:02 pm
by leonard007
Dear Professor Jpfeifer,
I am modeling a new model based on "Gertler and Kiyotaki 2015" for simulating the bank run in the Great recession. I have provided the external SS finder, in addition, I have checked the timing of the model. Unfortunately the model has singularity problem with two unit roots. When I check the problem with
Code: Select all
model_diagnostics(M_,options_,oo_)
it gives me
there is 1 colinear relationships between the variables...
with the large batch of variables and equations. I searched a lot in your previews comments e.g. http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=6478 and http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=6770 then tried to see if equations can provide the value of endogenous variables that the response was yes (I have added in the comment's part that which equation is identical for which variable). I have also checked the Walras law. I was wondering if you could guide me to find the problem? The model is attached here.

Sincerely,
Leo

Re: A problem related to singularity and colinear relationsh

PostPosted: Mon Mar 20, 2017 1:42 pm
by jpfeifer
The
Code: Select all
just_for_check_0_BR.mat
is missing.

If the unit roots are the only reason for collinearity, there is no problem with your model (unless the unit roots contradict the economic intuition).

Re: A problem related to singularity and colinear relationsh

PostPosted: Mon Mar 20, 2017 2:56 pm
by leonard007
I am really sorry for the missing file. Now it is complete.

Re: A problem related to singularity and colinear relationsh

PostPosted: Mon Mar 20, 2017 9:07 pm
by jpfeifer
model_diagnostics is not helpful here. You either have a timing problem or another mistake in the code that makes the BK conditions violated. The usual advice is to start with a simpler working version of the model and only then add features to it. One suggestion: the Lagrange multiplier lambda_m has a negative steady state. Shouldn't multipliers always be positive? Maybe you redefined it and that explains the negative number, but you should check.

Re: A problem related to singularity and colinear relationsh

PostPosted: Wed Mar 29, 2017 3:21 pm
by leonard007
Dear Professor Jpfeifer,
Thank you for your helpful reply. I have accurately verified the original mod file of the simpler model(which works and I have added the new features into it). In contrast with what is written in their paper ("Gertler and Kiyotaki 2015"), they have changed the timing of the deposit interest rate (in the paper it is " r * d(-1)" but in the mod file it is "r(-1)*d(-1)"). I did the same change and now my codes run. There are still 3 issues:
1. I have added borrowing feature to the model, so in addition to the interest rate , I have the return on banker's loans (r_b, please see equation 4). I doubt if I have changed the timing of r, I have to change the timing of r_b as well. In this case I will have again the timing problem.
2. After running the program, one will find that there is no IRF for K (total capital. Euq 30) that I guess it means its deviation is zero(It is not very normal !!!). Hence deviation of i_k( investment, Equ 38) is also zero. Furthermore due to these zero changes, even with a negative shock to productivity (Equ 40-41), the output change is positive! It is really strange.
3. I saw this post http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=3564 I have also capital belonging to bankers and lenders, is it the same case as mine and I should add
Code: Select all
K(-1) = K_b + K_h; //30
?

I really appreciate your time and consideration.

Sincerely,
Leo

Re: A problem related to singularity and colinear relationsh

PostPosted: Mon Apr 03, 2017 2:27 pm
by jpfeifer
Dear Leo,
unfortunately, it is very hard for me to follow this discussion, because I am not really familiar with the model you are dealing with.
1.) You need to understand why they use that timing. If you understand the intuition behind it, you will most probably know whether that also applies to your interest rate.
2.) The policy function for K is
POLICY AND TRANSITION FUNCTIONS
K
Constant 5.911734
h_P(-1) 5.726065
h_I(-1) 5.726065
M(-1) -0.606936
K_h(-1) 0.606936
K(-1) 0.356397
A(-1) 0.606936
p_k(-1) -2.459145
i_k(-1) 1.000000

Thus, the respective shock does not move it on impact. As the shock seems to move the variables entering here with a log, the effect on K of these variables seems to exactly offset each other. You need to understand why this is the case.
3. That depends on the way you want to set up your model

Re: A problem related to singularity and colinear relationsh

PostPosted: Wed Apr 05, 2017 3:53 pm
by leonard007
Dear Professor Jpfeifer,
Thank you for your kind reply. I am sorry for the first question, Yes you are right, it is my model and I myself have to know its aspects. I got the intuition of the first and third question, so they are ok now, but still I have not have any move on the second one and why the shock does not move "K" on impact. I was wondering if you know what is the usual reason on this problem(if it is usual!) and if there is any paper or possible link to help me find the problem?
Sincerely,
Leo

Re: A problem related to singularity and colinear relationsh

PostPosted: Sat Apr 08, 2017 8:59 pm
by leonard007
Dear Professor Jpfeifer,
I finally found the problem. It was an equation that was defined not very accurate and made a bad effect on capital. Thank you very much for your great helps.
Sincerely,
Leo

Re: A problem related to singularity and colinear relationsh

PostPosted: Sun Apr 09, 2017 3:36 pm
by jpfeifer
Glad to hear you solved the problem.