Hi everyone,

I’m trying to replicate the paper “Financial Intermediation and Credit Policy in Business Cycle Analysis”(Mark Gertler and Nobuhiro Kiyotaki,2010).I wrote the formula to the file as described in the article. However, I fail to reach a steady state. Results shows that the steady state contains NaN or Inf.

I am a total beginner with Dynare and this is my attempt at coding a model.

Any help would be greatly appreciated.

Many thanks,

Xiang

Since I am a new user and can’t upload files, I paste the contents of the file into the body and ask for help.

GK.mod

var Y C L I K Z D Ni Nn Si Sn Qi Qn R Rb v vb vs lambdai lambdan A psi;

varexo e1 e2;

parameters alpha gamma beta pii pin chi epsilon theta omega xi rhoa rhopsi sigmaa sigmapsi delta sigma;

alpha = 0.33;

gamma = 0.5;

beta = 0.99;

pii = 0.25;

pin = 1-pii;

chi = 5.013;

epsilon = 0.1;

theta = 0.1288;

omega = 0.5;

xi = 0.0019;

rhoa=0.95;

sigmaa=0.02;

rhopsi=0.66;

sigmapsi=-0.05;

delta = 0.027;

sigma = 0.975;

model;

Y = A*(K^alpha)*L^(1-alpha);
K(+1) = psi*(I+(1-delta)

*K);*

Y = C+(1+(I/I(-1)-1)^2)C)^(-1)-beta

Y = C+(1+(I/I(-1)-1)^2)

*I;*

beta((C(+1)-gammabeta

*gamma*(C(+2)-gamma

*C(+1))^(-1))*gamma*(C(+1)-gamma

*R(+1)=(C-gamma*C(-1))^(-1)-beta*C)^(-1);*

D = (QiSi-Ni)+(Qn

D = (Qi

*Sn-Nn);*

Z = alphaA*(L/K)^(1-alpha);

Z = alpha

Qi = 1+(I/I(-1)-1)^2+I/I(-1)

*2*(I/I(-1)-1)-beta*((C(+1)-gamma

*C)^(-1)-beta*gamma*(C(+2)-gamma

*C(+1))^(-1))/((C-gamma*C(-1))^(-1)-beta

*gamma*(C(+1)-gamma

*C)^(-1))*(I(+1)/I)^2

*2*(I(+1)/I-1);

Si = I+(1-delta)

*pii*K;

Sn = (1-delta)

*pin*K;

(1-alpha)

*(Y/L)*((C-gamma

*C(-1))^(-1)-beta*gamma*(C(+1)-gamma

*C)^(-1))=chi*L^epsilon;

lambdai = (vs/Qi-vb)/(theta*(1-omega)- (vs/Qi-vb));

lambdan = (vs/Qn-vb)/(theta*(1-omega)- (vs/Qn-vb));

vb-v = (theta

*omega*(pii

*lambdai+pin*lambdan))/(1+pii

*lambdai+pin*lambdan);

vb = Rb(+1)

*(beta*((C(+1)-gamma

*C)^(-1)-beta*gamma*(C(+2)-gamma

*C(+1))^(-1))/((C-gamma*C(-1))^(-1)-beta

*gamma*(C(+1)-gamma

*C)^(-1)))*(pii*((1-sigma)+sigma*(vb+lambdai*(vb-theta

*omega)))+pin*((1-sigma)+sigma*(vb+lambdan*(vb-theta

*omega))));*

v = R/Rbvb;

v = R/Rb

vs = (beta*((C(+1)-gamma

*C)^(-1)-beta*gamma*(C(+2)-gamma

*C(+1))^(-1))/((C-gamma*C(-1))^(-1)-beta

*gamma*(C(+1)-gamma

*C)^(-1)))*(pii*((1-sigma)+sigma*(vb+lambdai*(vb-theta

*omega)))+pin*((1-sigma)+sigma*(vb+lambdan*(vb-theta

*omega))))*(Z(+1)+(1-delta)

*(pii*Qi+pin

*Qn))*omega)

*psi(+1);*

QiSi = ((vb-thetaQi

*Ni-theta*omega

*pii*D/(1+pii

*lambdai+pin*lambdan))/(theta*(1-omega)-(vs/Qi-vb));

Qn

*Sn = ((vb-theta*omega)

*Nn-theta*omega

*pin*D/(1+pii

*lambdai+pin*lambdan))/(theta*(1-omega)-(vs/Qn-vb));

Ni = pii*((Z+(1-delta)

*Qi)*D(-1));

*psi*(sigma+xi)*Si(-1)-sigma*RNn = pin*((Z+(1-delta)

*Qn)*D(-1));

*psi*(sigma+xi)*Sn(-1)-sigma*RA = rhoa

*A(-1)+e1;*

psi = rhopsipsi(-1)+e2;

psi = rhopsi

end;

initval;

K = 30;

C = 3;

I = 0.9;

A = 1;

psi = 1;

R = 0.01;

D = 27;

e1 = 0;

e2 = 0;

end;

steady;

check;

shocks;

var e1 = sigmaa^2;

var e2 = sigmapsi^2;

end;

stoch_simul;

The results.

??? Error using ==> print_info at 90

The steady state contains NaN or Inf

Error in ==> steady at 104

print_info(info,options_.noprint, options_);

Error in ==> GK1 at 305

steady;

Error in ==> dynare at 235

evalin(‘base’,fname) ;