m.file or external function to solve the following model

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.

m.file or external function to solve the following model

Postby HouseC » Sun May 05, 2013 4:43 am

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
Last edited by HouseC on Sun Nov 03, 2013 3:33 am, edited 1 time in total.
HouseC
 
Posts: 41
Joined: Fri Apr 19, 2013 3:36 am

Re: m.file or external function to solve the following model

Postby efi » Wed May 08, 2013 8:40 am

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.
efi
 
Posts: 8
Joined: Thu May 02, 2013 7:26 am

Re: m.file or external function to solve the following model

Postby HouseC » Thu May 09, 2013 3:02 pm

efi wrote: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?
HouseC
 
Posts: 41
Joined: Fri Apr 19, 2013 3:36 am

Re: m.file or external function to solve the following model

Postby efi » Thu May 09, 2013 4:06 pm

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;
efi
 
Posts: 8
Joined: Thu May 02, 2013 7:26 am

Re: m.file or external function to solve the following model

Postby jpfeifer » Thu May 09, 2013 6:43 pm

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.
------------
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: m.file or external function to solve the following model

Postby HouseC » Fri May 10, 2013 4:22 am

efi wrote: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;


i agree with jpfeifer's comment, do you have the steady state value, which is reported under the matlab command window?
HouseC
 
Posts: 41
Joined: Fri Apr 19, 2013 3:36 am

Re: m.file or external function to solve the following model

Postby efi » Fri May 10, 2013 7:51 am

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


STEADY-STATE RESULTS:

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
efi
 
Posts: 8
Joined: Thu May 02, 2013 7:26 am

Re: m.file or external function to solve the following model

Postby HouseC » Mon May 13, 2013 3:53 am

efi wrote:Here are my results, but I am not sure how to deal with the value of 'lambda_n':


STEADY-STATE RESULTS:

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


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.
HouseC
 
Posts: 41
Joined: Fri Apr 19, 2013 3:36 am

Re: m.file or external function to solve the following model

Postby efi » Mon May 13, 2013 4:26 pm

This are my values for the case omega = 0. But I used the originial equations instead of the transformed with exp.
efi
 
Posts: 8
Joined: Thu May 02, 2013 7:26 am

Re: m.file or external function to solve the following model

Postby efi » Fri May 17, 2013 11:18 am

Hello HouseC, did you solved your problem ? Or receive you the same steady state values?
efi
 
Posts: 8
Joined: Thu May 02, 2013 7:26 am

Re: m.file or external function to solve the following model

Postby krust » Sat Jun 01, 2013 2:46 pm

Hello HouceC,

I also try to replicate GK in case of imperfect interbank market. Have you already solved your problem? I tried to solve it in the same way, but some equations differ from yours. I revieve IRFs they differ from the output in this paper. If you solved your problem could you give me a hint?

Or has someone else a replication file?
Thanks a lot!

Krust
krust
 
Posts: 1
Joined: Sat Jun 01, 2013 2:37 pm

Re: m.file or external function to solve the following model

Postby J.Höffler » Sat Aug 02, 2014 4:29 am

If you are interested in replication you may also want to take a look at this:
viewtopic.php?f=2&t=5926
J.Höffler
 
Posts: 15
Joined: Fri Aug 01, 2014 3:14 pm


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 8 guests

cron