A problem related to singularity and colinear relationships

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 model_diagnostics(M_,options_,oo_) it gives me

with the large batch of variables and equations. I searched a lot in your previews comments e.g. [Redundant equation and non-redundant equation is missing) and [Collinear equations) 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.

IRFs.zip (10.3 KB)

The 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).

I am really sorry for the missing file. Now it is complete.
Parameters.zip (15 KB)

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.

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 [Timing of capital in two sector economy) I have also capital belonging to bankers and lenders, is it the same case as mine and I should add K(-1) = K_b + K_h; //30?

I really appreciate your time and consideration.

IRFs.zip (11.5 KB)

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

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[/quote]

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

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?

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.

Glad to hear you solved the problem.