Hi,
I have a small dsge model, whose steady state I have computed with Newton Raphson method in another .m file. That gave me a vector of steady state values for model’s variables (the x vector). I want to accompany the steady state values by using external function and placing that vector of values into initval block of my .mod file. But whenever I do it, and plot the variables, it just plots the constant values I gave them in initval. How can I include the model dynamics there?

Thank you.

Here is the code of .mod file

``````var  c , k, h, i, q, y, r;

varexo c_eps;

parameters theta, rho, delta, alpha;

theta   = 0.05;
rho     = 0.02;
delta   = 0.1;
alpha   = 1/3;

external_function(name=ntr);

initval;
c=  x(1);
k=  x(2);
h=  x(3);
i=  x(4);
q=  x(5);
y=  x(6);
r=  x(7);
end;

model;
c = (theta+rho)*(k(-1)+h)+c_eps;
i = (q-1+delta)*k(-1);
k-k(-1) = y-c-delta*k(-1);
h(+1)-h=(r+rho)*h-y;
q(+1)-q=(r+delta-i/k(-1))*(q-1)+0.5*(q-1)^2;
y=k(-1)^alpha;
r=alpha*k(-1)^(alpha-1)-delta;
end;

resid(1);
check;

shocks;
var c_eps;
periods 1;
values  0;
end;

stoch_simul(order=1, irf=50, periods=200);

figure()
subplot(1,2,1)
plot(c)
title('consumption')

subplot(1,2,2)
plot(k)
title('capital')
``````

You are using a perfect foresight `shocks`-block with stochastic simulations. That won’t work.