Dynare does not find steady state despite manually calculated initial values

Hello everyone,

I am currently building a DSGE model, which I set up sequentially since Dynare did not find the steady state for the medium-sized one with all frictions. Right now, it contains:

  • Calvo style price and wage rigidities
  • Habit persistence
  • quadratic adjustment costs for investment relative to past investment faced by a capital Producer, who purchases the depreciated capital from the entrepreneur at t at price Q_t, augments it by investment and sells it as K(+1) to the entrepreneur at Q_t.
  • the entrepreneur is fully debt financed, which he raises at rate (1 + i) from the household; purchases the capital (K(+1)) at the end of t at price Q_t, rents it out at (1+rk) to the intermediate producer, and depreciates it afterwards at p_delta before he sells it to the capital producer again.

The Problem of not finding the Steady state reoccured after I added capital. I initially built the model only with labor in the production function, choice of the household etc. I am quite sure
that the initial values are correct. However, it does not find the steady state. What else can I do? Do I have a timing issue, which I have not spotted despite checking several times?
Here is the file:
NKBase5.mod (8.2 KB)

It would be great if someone could cross-check my work.

Update: Ok, I found one mistake. I had a typo in the initial value for h2. It should read 3.97821139. However, now the Blanchard Kahn conditions are not satisfied. :frowning: So most probably, it is a timing issue as I suspected.

If someone more experienced can spot it, I would be very thankful.

Given the size of your model, I would always compute the steady state analytically. That way, it is easier to debug the model.

Thank you very much for your suggestion, Prof. Pfeiffer. Unfortunately, I have done this already. This is the Matlab code, that I used to calculate the initial values of the steady state:

syms C i pi whash h1 h2 w N K Invest rk mc A Y vp pihash x1 x2 v_lambda v Q mu;
syms p_alpha p_delta p_epsp p_epsw p_phip p_phiw p_beta p_sigma p_psi p_chi p_rhoa p_rhoi p_phipi p_piss p_iss p_b p_rhov p_kappa;

p_alpha =   1/3;
p_delta =   0.025;
p_epsp  =   10;
p_epsw  =   10;
p_phip  =   0.75;
p_phiw  =   0.75;
p_beta  =   0.99;
p_sigma =   1;
p_psi   =   1;
p_chi   =   1;
p_rhoa  =   0.95;
p_rhoi  =   0.8;
p_phipi =   1.5;
p_piss  =   0;
p_iss   =   0.005;
p_b     =   0.6;
p_rhov  =   0.8;
p_kappa =   2;

Q = 1;
A=1;
vp=1;
v=1;
mu=1;
i =1/p_beta*(1+p_piss)-1;
mc=(p_epsp-1)/p_epsp;
rk=(1+i+Q-p_beta*(Q*(1-p_delta)))/p_beta-1;
N=(((1-p_beta*p_b)*(1-p_alpha)*(p_epsw-1))/((1-p_b)*((p_epsp-1)/p_epsp-p_delta*p_alpha/(1+rk))*p_epsw))^(1/(1+p_chi));
K=((1+rk)/(p_alpha*mc*N^(p_alpha-1)))^(1/(p_alpha-1));
Y=A*N^(1-p_alpha)*K^p_alpha/vp;
Invest=p_delta*K;
C=Y-Invest;
w=mc*(1-p_alpha)*A*(K/N)^p_alpha;
v_lambda=1/C*(1-p_beta*p_b)/(1-p_b);
x1=v_lambda*Y*mc/(1-p_beta*p_phip*(1+p_piss)^p_epsp);
x2=v_lambda*Y/(1-p_beta*p_phip*(1+p_piss)^(p_epsp-1));
h1=p_psi*w^(p_epsw*(1+p_chi))*N^(1+p_chi)/(1-p_beta*p_phiw*(1+p_piss)^(p_epsw*(1+p_chi)));
h2=N*v_lambda*w^p_epsw/(1-p_beta*p_phiw*(1+p_piss)^(p_epsw-1));
whash=((w^(1-p_epsw)*(1-p_phiw*(1+p_piss)^(p_epsw-1)))/(1-p_phiw))^(1/(1-p_epsw));
pihash=p_epsp/(p_epsp-1)*(1+p_piss)*x1/x2-1;
pi=pihash;

This leads to the initial values used in the updated file (see below).

However, the model analytics show that there are 12 eigenvalues with a modulus larger than 1 for 13 forward looking variables, so that my rank-condition is not verified.

Leading to Blanchard Kahn indeterminancy.
Or am I heading into a wrong direction if I suppose that somewhere a timing issue is not correct?
NKBase5.mod (8.2 KB)

I found a solution, so that the BK conditions are obviously being met. However, this confuses me. In the beginning, I defined the evolution of capital as:
K(+1) = (1 - p_delta) * K + (1 - p_kappa / 2 * (Invest / Invest(-1) - 1)^2)*Invest;
I subsequently changed it to
K = (1 - p_delta) * K(-1) + (1 - p_kappa / 2 * (Invest(-1) / Invest(-2) - 1)^2)*Invest(-1);
This should be identical in accordance to the handbook. Why is dynare interpreting it differently?

Also the steady state values that it returns are partly way off and not realistic (e.g. return on capital (rk))

C 4.40547e-06
i 0.0108957
pi 0.000786088
whash 0.575477
h1 1.82292e-05
h2 0.00883536
w 0.574103
N 1.00968e-06
K 2.79786e-07
Invest -2.1992e-06
rk 0.0358957
mc 1.32089
A 1
Y 2.53825e-11
vp 0.115085
pihash 0.245316
x1 7.09061e-05
x2 6.33144e-05
v_lambda 1
v 1
Q 1
  1. You are violating Dynare’s timing convention for predetermined variables. If you want to use your stock at the beginning of period, you need to define predetermined_variables K;
  2. If you have an analytical steady state, use a steady_state_model-block. Given that your initial values are not the same as the detected steady state, either the model equations or your steady state computation are wrong.