# M.file or external function to solve the following model

Hi, I am trying to calibrate the model by Gertler and Kiyotaki(2010). the mod file is attached. I need to guess the initial value for this model. And i have try to use matlab code"broyden" to solve the non-linear system, but i failed. Anyone who are good at solving the steady state system by using matlab function? pls give me a hand. thx a lot

I would try to get the steady state values as described in this article with dynare. You find a small description in Appendix 1 at the end of the text. You can then use the determined steady state values as initial values.

i know what they discribe in the appendix, still ifailed to get the steady state, did you success in guessing the value?

Hello HouseC,

yes I tried it and I got Steady State Values. But with this initial values, the model does not work…I think I have false timing conventions on my variables. Have you already thought about the selection of predetermined variables?

Here my way to get the steady state values:
First I guess you have to write two .mod-files.

• First you determine the steady state values of the banks. But you have to eliminate the “K” -> then you have the variables DoverK;NioverK and NnoverK. Wenn you run this file you get Z.
• Then use Z as parameter in the second file. You use the second mod.file to determine the remaining variables.

After that you multiply DoverK;NioverK and NnoverK with K to get D, Ni and Nn.
Unfortunately my Lambda_n is negative. I set it to zero…

Then you get the following initial values (Which unfortunatly do not work in the full model):
initval;
%A=0;
PSI=0;
%A_eps=0;
Psi_eps=0;
Qi =1;
Qn = 1.058;
R=1/beta;
Rb=1.0101;
Y = 0.746634;
C =0.574446;
L = 0.249937;
I = 0.172188;
K =6.88751;
Z =0.0357733;
D = 6.2919539;
N_i =0.15078756;
N_n =0.736908;
S_i= 1.85605;
S_n=5.03649;
nu =1.09282;
nu_s =1.1328;
nu_b =1.09282;
lambda_i = 0.449051;
lambda_n =0;
u_C = 1.758216;
Omega = 1.193;
Omega_i = 1.5;
Omega_n = 1.09022104;

Regardless of whether the timing is correct or not, you should get a steady state. If you put steady in your model, Dynare will give you the actual steady state values in the command window (if the steady state has been found). Please post those values instead of your starting values.

[quote=“efi”]Hello HouseC,

yes I tried it and I got Steady State Values. But with this initial values, the model does not work…I think I have false timing conventions on my variables. Have you already thought about the selection of predetermined variables?

Here my way to get the steady state values:
First I guess you have to write two .mod-files.

• First you determine the steady state values of the banks. But you have to eliminate the “K” -> then you have the variables DoverK;NioverK and NnoverK. Wenn you run this file you get Z.
• Then use Z as parameter in the second file. You use the second mod.file to determine the remaining variables.

After that you multiply DoverK;NioverK and NnoverK with K to get D, Ni and Nn.
Unfortunately my Lambda_n is negative. I set it to zero…

Then you get the following initial values (Which unfortunatly do not work in the full model):
initval;
%A=0;
PSI=0;
%A_eps=0;
Psi_eps=0;
Qi =1;
Qn = 1.058;
R=1/beta;
Rb=1.0101;
Y = 0.746634;
C =0.574446;
L = 0.249937;
I = 0.172188;
K =6.88751;
Z =0.0357733;
D = 6.2919539;
N_i =0.15078756;
N_n =0.736908;
S_i= 1.85605;
S_n=5.03649;
nu =1.09282;
nu_s =1.1328;
nu_b =1.09282;
lambda_i = 0.449051;
lambda_n =0;
u_C = 1.758216;
Omega = 1.193;
Omega_i = 1.5;
Omega_n = 1.09022104;[/quote]

i agree with jpfeifer’s comment, do you have the steady state value, which is reported under the matlab command window?

Here are my results, but I am not sure how to deal with the value of ‘lambda_n’:

I 0.172188
C 0.574446
K 6.88753
L 0.249938
Z 0.0357732
Qn 1.058
Nn 0.736906
Ni 0.150788
D 6.29198
nu 1.09283
nu_s 1.1328
nu_b 1.09283
R_b 1.0101
lambda_i 0.449053
lambda_n -0.146422

[quote=“efi”]Here are my results, but I am not sure how to deal with the value of ‘lambda_n’:

I 0.172188
C 0.574446
K 6.88753
L 0.249938
Z 0.0357732
Qn 1.058
Nn 0.736906
Ni 0.150788
D 6.29198
nu 1.09283
nu_s 1.1328
nu_b 1.09283
R_b 1.0101
lambda_i 0.449053
lambda_n -0.146422[/quote]

hi, efi. Which case you try to calibrate? perfect interbank market or case with friction? I try to use your ss value, but I still failed.

This are my values for the case omega = 0. But I used the originial equations instead of the transformed with exp.