Hi,
I am trying to integrate a matching function into a NK DSGE model with some financial frictions.
I wrote dynare code for the decentralized Merz (1995) model to represent the labor market frictions, which I then want to plug into the final DSGE. For some reason Dynare gives me this mistake:
Error using print_info (line 83)
Impossible to find the steady state. Either the model doesn’t have a steady state, there are an infinity of
steady states, or the guess values are too far from the solution
When I run the S. Planners’ version with similar calibration - everything works perfect.
Maybe I’ve messed up with some equations, but unfortunately cannot spot the mistake so far.
I will be really grateful for any help!
Here is the code.
P.S. If you have a working bit of code on matching functions to put into NK DSGE - that might be even better:) Basically I just need to track the response of unemployment to some monetary shocks, sticky wages etc. are not necessary in this case.
Thank you in advance!
% The decentralized model of Merz (1995)
% In log deviations
% This .mod file sets cs and etas to fix search intensity
//endogenous variables
var varrho G p q r W C Y I S V M U Z K N y_dev u_dev v_dev;
//predetermined variables
predetermined_variables K N;
//exogenous variables
varexo e_Z;
//parameters
parameters lambda alpha rho cs etas cv etav delta_prime psi beta sig_e nu_est;
//initialize parameters
lambda=0.4;
alpha=0.36;
rho=0.95;
cs=0.00000000001;
etas=1000000000;
cv=0.05;
etav=1;
delta=0.022;
mu=0.004;
delta_prime=1-(1-delta)*(exp(-mu));
psi=0.07;
beta= 1/(1.04^(1/4));
nu_est=0.8;
sig_e=0.007;
//model equations
model;
//----------- Household -----------------------------------
// 1. Marginal Untility from Consumption
[varrho]
exp(varrho) = (1/exp(C));
// 2. Marginal Disutility from Work
[G]
exp(G)=exp(N)^(nu_est);
// 3. Consumption Euler equation
[C]
exp(varrho) = beta*exp(varrho(+1))*(exp(r(+1))+1-delta_prime);
// 4. Search intensity Euler equation
[S]
//(1/exp(C))*cs=exp(P)*beta*((1/exp(C(+1)))*(W(+1)+cs)-exp(G(+1))+((1/exp(C(+1)))*cs/exp(P(+1)))*(1-psi-exp(P(+1))*S(+1)));
exp(varrho)*cs = exp(p)*beta*(exp(varrho(+1))*(W(+1)+cs)-exp(G(+1))+exp(varrho(+1))*cs/exp(p(+1))*(1-psi-exp(p(+1))*S(+1)));
//------------- Firm --------------------------------------
// 5. Production function
[Y]
exp(Y)=e`Preformatted text`xp(Z)*exp(K)^alpha*(exp(N))^(1-alpha);
// 6. Interest rate
[r]
exp( r)=alpha*exp(Y)/exp(K);
// 7. Vacancy creation Euler equation [cv - vacancy posting costs]
[V]
//(1/exp(C))*cv=(1-lambda)*exp(M)/exp(V)*beta*(1/exp(C(+1)))*((1-alpha)*exp(Y(+1))/exp(N(+1))-exp(W(+1))+(cv/((1-lambda)*exp(M(+1))/exp(V(+1))))*(1-psi));
exp(varrho) * cv = exp(q) * beta * exp(varrho(+1))*((1-alpha) * exp(Y(+1)) / exp(N(+1)) - exp(W(+1)) + (cv/exp(q(+1))) * (1-psi));
// 8. Wage
[W]
exp(W) = lambda*((1-alpha)*exp(Y)/exp(N)+cv*exp(V-U))+(1-lambda)*(exp(G)/exp(varrho)-cs);
// --------Equlibrium market clearing ----------------------
// 9. Aggregate Reource constraint
[I]
exp(Y)=exp( C)+exp(I)+cs*exp(S)^etas*exp(U)+cv*exp(V)^etav;
//----------Declarations------------------------------------
// 10. Unemployment
[U]
exp(U)=1-exp(N);
// 11. Matching function
[M]
exp(M)=(exp(V)^(1-lambda))*(exp(S+U))^lambda;
// 12. Kapital dynamics
[K]
exp(K(+1))=(1-delta_prime)*exp(K)+exp(I);
// 13. Labor dynamics
[N]
exp(N(+1))=(1-psi)*exp(N)+exp(M);
// 14. Probability of finding job
[p]
exp( p)=exp(M)/(exp(S+U));
//exp(P)=exp(M)/(exp(S)*exp(U));
// 15. Job match probability
[q]
exp(q)=(1-lambda)*exp(M)/exp(V);
// 16. Labor augmenting factor
[Z]
Z=rho*Z(-1)+e_Z;
// 17. Labor market tightness
//[theta]
// exp(theta)=exp(V-U);
// 18. Avg.labor productivity
//[Pr]
// exp(Pr)=exp(Y-N);
//--------- Cental Planner - [commented out] --------------
//MC of searching = MB from working
// (cv*etav*exp(V)^(etav-1)/(exp(C)*(1-lambda)*exp(M-V)))=beta*((1/exp(C(+1)))*((1-alpha)*exp(Y(+1)-N(+1))+cs*exp(S(+1))^etas)-exp(N(+1))^(1/nu_est)+(cv*etav*exp(V(+1))^(etav-1)/(exp(C(+1))*(1-lambda)*exp(M(+1)-V(+1))))*(1-psi-lambda*exp(M(+1))/exp(U(+1))));
//MC of searching = MC of posting vacancies
// (cs*etas*exp(S)^(etas)*exp(U)/((lambda)))=(cv*etav*exp(V)^(etav)/((1-lambda)));
//Labor market tightness
// exp(theta)=exp(V-U);
//Budget constraint
// exp(C)=exp(Y)-exp(I)-cs*exp(S)^etas*exp(U)-cv*exp(V)^etav;
// 16. Output deviation from St.St.
[y_dev]
y_dev = Y-STEADY_STATE(Y) ;
// 17. Unmployment deviation from St.St.
[u_dev]
u_dev = U-STEADY_STATE(U) ;
//18. Vacancy deviation from St.St.
[v_dev]
v_dev = V-STEADY_STATE(V) ;
end;
//initial values for parameters
initval;
W=0.8513;
G=-0.0688;
varrho=-0.9097;
r=-3.3298;
C=0.909695877517769;
Y=1.21297419220172;
I=-0.131035097064121;
S=7.88090800314440e-10;
V=-2.91164322016667;
M=-2.74529037907900;
U=-2.49576111823558;
p=-0.2495;
q=-0.3445;
Z=1;
K=3.52231558659806;
N=-0.0860303421462215;
//Pr=1.29900453434794;
y_dev=0;
u_dev=0;
v_dev=0;
end;
check;
//calculate steady state
steady;
//variance of shocks
shocks;
var e_Z=sig_e^2;
end;
stoch_simul(periods=2100);