Replication of Investor borrowing heterogeneity in a Kiyotaki–Moore style macro model

Dear users,
I am in the beginner level of Dyanre and DSGE model.
I am very interested in DSGE model with financial frictions. To this end, I studied the Kiyotaki and Moore (1997) ‘Credit cycles’ paper using Dynare and did the replication of this paper. Then I chose the paper: “Investor borrowing heterogeneity in a Kiyotaki–Moore style macro model Economics Letters 130 (2015) 75-79 by Maria Teresa Punzi and Katrin Rabitsch in order to better understand the more realistic case with heterogeneous agents and tried to write Dynare code based on Kiyotaki and Moore (1997) model.

Following the paper setting & equations with one representative saver, 5 heterogeneous investors, and one representative firm, I understand that I should finally set the economy with 53 endogenous variables to compute. Thus I did write the attached Dynare file.

My current Dyanre file however has some error messages and does not work as follows:

Starting Dynare (version 4.5.1).
Starting preprocessing of the model file …
Found 53 equation(s).
Evaluating expressions…done
Computing static model derivatives:

  • order 1
    Computing dynamic model derivatives:
  • order 1

Processing outputs …
ERROR: Can’t open file ResearchProject_exercise/checksum

Now I feel that I get lost in the replication processes . Anyone could help me?ResearchProject_exercise.mod (11.1 KB)
1-s2.0-S0165176515001007-main Investor borrowing heterogeneity in a Kiyotaki–Moore style macro model.pdf (549.4 KB)

The error message is a file access problem that should vanish upon closing and restarting Matlab. Once you do that, you will get an error, because

(qss1)*(KI1ss-KI1ss)+Rss*(BI1ss)+(CI1ss) = (LI1ss)*(WI1ss)+(RK1ss)*(KI1ss)+BI1ss; //eq(2)budget constraint of investor 1 at steady state
(qss2)*(KI2ss-KI2ss)+Rss*(BI2ss)+(CI2ss) = (LI2ss)*(WI2ss)+(RK2ss)*(KI2ss)+BI2ss;//eq(2)budget constraint of investor 2 at steady state
(qss3)*(KI3ss-KI3ss)+Rss*(BI3ss)+(CI3ss) = (LI3ss)*(WI3ss)+(RK3ss)*(KI3ss)+BI3ss;//eq(2)budget constraint of investor 3 at steady state
(qss4)*(KI4ss-KI4ss)+Rss*(BI4ss)+(CI4ss) = (LI4ss)*(WI4ss)+(RK4ss)*(KI4ss)+BI4ss;//eq(2)budget constraint of investor 4 at steady state
(qss5)*(KI5ss-KI5ss)+Rss*(BI5ss)+(CI5ss) = (LI5ss)*(WI5ss)+(RK5ss)*(KI5ss)+BI5ss;//eq(2)budget constraint of investor 5 at steady state

is not a valid definition. In the parameter definitions, you cannot have Dynare solve systems of equations. You need to do that yourself.

P.S.: Would you be willing to share your replication of Kyotaki/Moore (1997)?

Dear Johannes Pfeifer,
Thank you so much for your reply. Still I am doing this mod file but I am not sure if I am right or not.
I also attach the kM model mod file which is base of my posted mod file.

Best regards,kmwithK_2017.mod (1.2 KB)