Kiyotaki Moore?

Does anybody know how to write dynare mod programs for Kiyotaki-Moore credit cycles model or something similar? Any guidance will be appreciated.

Hi,

I am using an extension of the above mentioned paper, but to start out I am trying to reproduce a very very simplified form (patient and impatient households with only land as a factor of production and credit constraints) of the original model with Dynare. I have written the mod file, but when I run it, I am getting the following errors:

Maximum number of iterations reached:
increase options.MaxIter.
??? Error using ==> steady_ at 77
STEADY: convergence problems

Error in ==> steady at 52
steady_;

Error in ==> KM1 at 114
steady;

Error in ==> dynare at 102
evalin(‘base’,fname) ;

What does this mean? Can somebody help? I have attaced my mod file.
KM1.mod (688 Bytes)

That error means that DYNARE cannot find the non-stochastic steady-state of your model. Typically this happens when the initial values you provide are too far from the true steady-state (assuming your model has a steady-state). Can you solve for the steady-state by hand? If so, you can put those values into a file called KM1_steadystate.m in the same directory; DYNARE will then use that steady-state (after it checks to make sure it is valid).

I have attached a mod file that reproduces the figure 3 of Kiyotaki and Moore (1997).

Stéphane
KiyotakiMoore97.mod (1.01 KB)

pintus_wen_dynarefile.mod (2.39 KB)

[quote=“macroeconomist”]Hi,

I am using an extension of the above mentioned paper, but to start out I am trying to reproduce a very very simplified form (patient and impatient households with only land as a factor of production and credit constraints) of the original model with Dynare. I have written the mod file, but when I run it, I am getting the following errors:

Maximum number of iterations reached:
increase options.MaxIter.
??? Error using ==> steady_ at 77
STEADY: convergence problems

Error in ==> steady at 52
steady_;

Error in ==> KM1 at 114
steady;

Error in ==> dynare at 102
evalin(‘base’,fname) ;

What does this mean? Can somebody help? I have attaced my mod file.[/quote]

Hi,
I post the code to replicate a very similar paper to Kiotachi-Moore, the authors are Pintus and Wen (basically it is KM97 with habit consumption as a twist), hope is useful!
(Run main m file that calls the mod file)
pintus_wen_main.m (7.68 KB)

Hello,

I’m trying to simulate a RBC model inspirred from KM97 and Pintus and Wen. the files poster in this disscussion were very helpful for me to write my code. However, i still can not any results of my model simulation. i obtain Error using ==> dynare at 114. DYNARE: preprocessing failed.

Please find attached the mod file for my model

Please can you help? :neutral_face:
RBC.mod (1.61 KB)

Always post full error messages. Dynare says

[quote]ERROR: RBC.mod:24.8-12: To use an external function (k) within the model block, you must first declare it via the external_function() statement.

??? Error using ==> dynare at 122
DYNARE: preprocessing failed[/quote]

The problem is in line 24 at column 8. There, you use a lowercase k, but you only defined uppercase K as a variable. As Dynare is case-sensitive, this gives an error.

I am using an extension of the above mentioned paper, but to start out I am trying to reproduce a very very simplified form (patient and impatient households with only land as a factor of production and credit constraints) of the original model with Dynare.

Hi,
I post the code to replicate a very similar paper to Kiotachi-Moore, the authors are Pintus and Wen (basically it is KM97 with habit consumption as a twist), hope is useful!
(Run main m file that calls the mod file)

Sorry youo posted the pintus-wen mod file main mod file but unfortunately I could not run it. There’s apparently a missing file; I got this message when running the file:

??? Undefined command/function ‘steady_ykl’.

Error in ==> pintus_wen_main>@(x) steady_ykl(x,param) at 172
[x,val_eq] = fsolve(@(x) steady_ykl(x,param),x0);

Error in ==> fsolve at 180
fuser = feval(funfcn{3},x,varargin{:});

Error in ==> pintus_wen_main at 172
[x,val_eq] = fsolve(@(x) steady_ykl(x,param),x0);

Could you please attache it? Many thnaks in advance