Page 1 of 1

Steady state okay, but no stable equilibrium

PostPosted: Sat Jan 31, 2015 5:14 pm
by rbcman
Hello,

I am replicating a fairly simple RBC model with a human capital sector. Particularly, I am trying to replicate this paper: https://www.aeaweb.org/aea/2013conferen ... ?pdfid=191

I have the code below and I try to solve it using logs (in exp). The steady states exist but it gives me error message:

One of the eigenvalues is close to 0/0 (the absolute value of numerator and denominator is
smaller than 1e-006!

I know I have entered the model correctly but dynare give me error message. I checked the other topics related to this but the answer is usually vague. Any help is appreciated. Below is the code I am using.

// Endogenous variables
var Y C N M L IK IH K H V Z S lambda mu YV YK YH YN IHV IHK IHM IHH;

// Exogenous variables
varexo z s;

// Parameters
parameters beta sigma A phi1 phi2 deltak deltah Ag Ah rhoz rhos sigmaz sigmas;
beta = 0.986;
sigma = 1;
A = 1.55;
phi1 = 0.36;
phi2 = 0.11;
deltak = 0.02;
deltah = 0.005;
Ag = 1;
Ah = 0.0461;
rhoz = 0.95;
rhos = 0.95;
sigmaz = 0.0007;
sigmas = 0.0007;

// Model structure
model;
exp(L) = 1-exp(M)-exp(N);
exp(L)^A*(exp(C)*exp(L)^A)^(-sigma) = exp(lambda);
A*exp(C)*exp(L)^(A-1)*(exp(C)*exp(L)^A)^(-sigma)= exp(lambda)*exp(YN);
A*exp(C)*exp(L)^(A-1)*(exp(C)*exp(L)^A)^(-sigma)= exp(mu)*exp(IHM);
exp(lambda)*exp(YV) = exp(mu)*exp(IHV);
exp(lambda) = beta*(exp(lambda(+1))*(exp((YK(+1))+1-deltak))+exp(mu(+1))*exp(IHK(+1)));
exp(mu) = beta*(exp(lambda(+1))*exp(YH(+1))+exp(mu(+1))*(exp(IHH(+1))+1-deltah));
exp(C) = exp(Y) - exp(IK);
exp(K) = exp(IK) + (1-deltak)*exp(K(-1));
exp(H) = exp(IH) + (1-deltah)*exp(H(-1));
exp(Y) = Ag*exp(Z)*(((V))^(phi1))*((exp(K(-1)))^(phi1))*((exp(N))^(1-phi1))*((exp(H))^(1-phi1));
exp(YV) = phi1*Ag*exp(Z)*(((V))^(phi1-1))*((exp(K(-1)))^(phi1))*((exp(N))^(1-phi1))*((exp(H))^(1-phi1));
exp(YK) = phi1*Ag*exp(Z)*(((V))^(phi1))*((exp(K(-1)))^(phi1-1))*((exp(N))^(1-phi1))*((exp(H))^(1-phi1));
exp(YN) = (1-phi1)*Ag*exp(Z)*(((V))^(phi1))*((exp(K(-1)))^(phi1))*((exp(N))^(-phi1))*((exp(H))^(1-phi1));
exp(YH) = (1-phi1)*Ag*exp(Z)*(((V))^(phi1))*((exp(K(-1)))^(phi1))*((exp(N))^(1-phi1))*((exp(H))^(-phi1));
exp(IH) = Ah*exp(S)*((1-(V))^(phi2))*((exp(K(-1)))^(phi2))*((exp(M))^(1-phi2))*((exp(H))^(1-phi2));
exp(IHV) = phi2*Ah*exp(S)*((1-(V))^(phi2-1))*((exp(K(-1)))^(phi2))*((exp(M))^(1-phi2))*((exp(H))^(1-phi2));
exp(IHK) = phi2*Ah*exp(S)*((1-(V))^(phi2))*((exp(K(-1)))^(phi2-1))*((exp(M))^(1-phi2))*((exp(H))^(1-phi2));
exp(IHM) = (1-phi2)*Ah*exp(S)*((1-(V))^(phi2))*((exp(K(-1)))^(phi2))*((exp(M))^(-phi2))*((exp(H))^(1-phi2));
exp(IHH) = (1-phi2)*Ah*exp(S)*((1-(V))^(phi2))*((exp(K(-1)))^(phi2))*((exp(M))^(1-phi2))*((exp(H))^(-phi2));
Z = rhoz*Z(-1)+z;
S = rhos*S(-1)+s;
end;


// Initial values
initval;
Y = 0;
C = 0;
N = 0;
M = 0;
L = 0;
K = 0;
H = 0;
IK = 0;
IH = 0;
YK = 0;
YN = 0;
YH = 0;
YV = 0;
IHK = 0;
IHM = 0;
IHH = 0;
IHV = 0;
lambda = 0;
mu = 0;
V = 0.95;
Z = 0;
S = 0;
end;

steady(solve_algo=4,maxit=1000);

model_diagnostics;
shocks;
var z = sigma;
var s = sigma;
end;
check;
stoch_simul(periods=1000);

Re: Steady state okay, but no stable equilibrium

PostPosted: Sat Jan 31, 2015 6:01 pm
by jpfeifer
Why does the referenced paper have 7 equations while you have 22?

Re: Steady state okay, but no stable equilibrium

PostPosted: Sat Jan 31, 2015 6:09 pm
by rbcman
Good one. What I tried to do was to write the derivatives of the production function and human cap production function separately so there were additional equations. The structural equations are all the same.

Re: Steady state okay, but no stable equilibrium

PostPosted: Sun Feb 01, 2015 7:44 am
by jpfeifer
Please try to replicate the paper as is before adding anything to it.

Re: Steady state okay, but no stable equilibrium

PostPosted: Wed Feb 04, 2015 5:26 am
by rbcman
Hello,

I did as you instructed and the model now has a stable steady state. There are 9 equations - 7 that is in the appendix plus 2 shocks. But now I am getting the error message:

There are 8 eigenvalue(s) larger than 1 in modulus
for 7 forward-looking variable(s)

The rank condition ISN'T verified!

Does it mean that there is a timing issue? Human capital is pre-determined so I have it with (-1) but it still gives me that same error message. Any help is appreciated.

Below is the code:


// Replication of Real Business Cycles with a Human Capital
// Investment Sector and Endogenous Growth:
// Persistence, Volatility and Labor Puzzles
//
// https://www.aeaweb.org/aea/2013conferen ... ?pdfid=191
//
// Endogenous variables
var C N M Z V K H S P;

// Exogenous variables
varexo z s;

// Parameters
parameters beta sigma A phi1 phi2 deltak deltah Ag Ah rhoz rhos sigmaz sigmas gamma;
beta = 0.986;
sigma = 1;
A = 1.5455;
phi1 = 0.36;
phi2 = 0.11;
deltak = 0.02;
deltah = 0.005;
Ag = 1;
Ah = 0.0461;
rhoz = 0.95;
rhos = 0.95;
sigmaz = 0.0007;
sigmas = 0.0007;
gamma = 0.0042;

// Model structure
model;

// equation 28
A*exp(C)/(1-exp(N)-exp(M))=(1-phi1)*Z*(((exp(V)*exp(K(-1)))/(exp(N)*exp(H(-1))))^phi1)*H(-1);

// equation 29
(1-phi1)*exp(V)/(phi1*exp(N))=(1-phi2)*(1-exp(V))/(phi2*exp(M));

// equation 30
exp(P)=((phi1/phi2)^phi2)*(((1-phi1)/(1-phi2))^(1-phi2))*(exp(V)*exp(K(-1))/(exp(N)*exp(H(-1))))^(phi1-phi2);

// equation 31 - Euler
1/beta=((exp(C)/exp(C(+1)))^sigma)*(1+gamma)^(-sigma)*((1-exp(N(+1))-exp(M(+1)))/(1-exp(N)-exp(M)))^(A*(1-sigma))*(phi1*exp(Z(+1))*((exp(V(+1))*exp(K)/(exp(N(+1))*exp(H)))^(phi1-1)+1-deltak));

// equation 32 - Euler
1/beta=(exp(P(+1)/exp(P)))*((exp(C)/exp(C(+1)))^sigma)*(1+gamma)^(-sigma)*((1-exp(N(+1))-exp(M(+1)))/(1-exp(N)-exp(M)))^(A*(1-sigma))*((exp(N(+1))+exp(M(+1)))*(1-phi2)*exp(S(+1))*((1-exp(V(+1))))*exp(K)/(exp(M(+1))*exp(H))+1-deltah);

// equation 33
exp(C)+(1+gamma)*exp(K)-(1-deltak)*exp(K(-1))=Ag*exp(Z)*((exp(V)*exp(K(-1)))^phi1)*(exp(N)*exp(H(-1)))^(1-phi1);

// equation 34
(1+gamma)*exp(H)-(1-deltah)*exp(H(-1))=Ah*exp(S)*(((1-exp(V))*exp(K(-1)))^phi2)*((exp(M)*exp(H(-1)))^(1-phi2));

// technology shock
Z = rhoz*Z(-1)+ z;

// technology shock
S = rhoz*S(-1)+ s;

end;


// Initial values
initval;
C = 0;
N = 0;
M = 0;
Z = 0;
V = -2;
K = 0;
H = 0;
S = 0;
P = 0;
Z = 1;
S = 1;
end;

steady(solve_algo=4,maxit=1000);

model_diagnostics;
shocks;
var z = sigma;
var s = sigma;
end;
check;
stoch_simul(periods=1000);

Re: Steady state okay, but no stable equilibrium

PostPosted: Sat Feb 14, 2015 12:32 pm
by jpfeifer
Hard to tell. You need to check your equations and the ones in the paper. In equation 32 for example, you have M(+1) in the denominator and the paper just has M. In equation 28, you have Z but it should be exp(Z)