I try to use this function argument but it doesn’t generate any binary file with the simulation results. Why is this happening?
simul_replic = 10000
Number of series to simulate when empirical moments are requested (i.e. periods
> 0). Note that if this option is greater than 1
, the additional series will not be used for computing the empirical moments but will simply be saved in binary form to the file FILENAME_simul. Default: 1
.
The code follow bellow:
%----------------------------------------------------------------
%% Declaring variables and parameters
%----------------------------------------------------------------
var c h y i k t lna lambda d d_y tb_y ca_y r r_star riskpremium util;
varexo e e_rs;
parameters gam omega rho sigma delta zeta alph phi r_bar dy_bar beta s;
gam = 2;
omega = 1.6;
alph = 0.32;
phi = 0.028;
dy_bar = 0.503;
zeta = 0.161;
r_bar = 0.086-zeta*dy_bar;
beta = 1/(1+r_bar+zeta*dy_bar);
delta = 0.082;
rho = 0.2;
sigma = 0.2;
s = ((zeta*dy_bar)/(1 + r_bar))*(1+r_bar)*0.59373;
%----------------------------------------------------------------
%% Model Block
%----------------------------------------------------------------
model;
% Resource Constraint
d = (1+t(-1))*(1+r(-1))*d(-1)- y + c + i + (phi/2)*(k-k(-1))^2 - s;
% Production function
y = exp(lna)*(k(-1)^alph)*(h^(1-alph));
% Law of motion for capital
k = i+(1-delta)*k(-1);
% Capital Control Equation
t=(((1-zeta)+r_star+zeta*(exp(d_y-dy_bar))*(1+d_y))/((1-zeta)+r_star+zeta*(exp(d_y-dy_bar))))-1;
% Euler equation
lambda= beta*(1+r)*lambda(+1)*(1+t);
% Consumption FOC
lambda = (c-((h^omega)/omega))^(-gam);
% Labor FOC
((c-((h^omega)/omega))^(-gam))*(h^(omega-1)) = lambda*(1-alph)*y/h;
% Investment FOC
lambda*(1+phi*(k-k(-1))) = beta*lambda(+1)*(alph*y(+1)/k+1-delta+phi*(k(+1)-k));
% Law of motion for TFP
lna = rho*lna(-1)-e;
% International interest rate
r_star = r_bar + sigma*e_rs;
% Domestic interest rate
r = r_star+riskpremium;
% Risk premium
riskpremium = zeta*(exp(d_y-dy_bar)-1);
% Additional calculations
util=(((c-omega^(-1)*h^omega)^(1-gam))-1)/(1-gam);
tb_y = 1-((c+i-s+(phi/2)*(k-k(-1))^2)/y);
ca_y = (1/y)*(d(-1)-d);
d_y = d/y;
end;
%----------------------------------------------------------------
% Steady State Block
%----------------------------------------------------------------
// See modelcomtaxae_steadystate
steady;
check;
%----------------------------------------------------------------
%% Ramdom Shock Block
%----------------------------------------------------------------
shocks;
var e; stderr sigma;
%var e_rs; stderr 1/sigma;
end;
%----------------------------------------------------------------
%% Solve the model
%----------------------------------------------------------------
stoch_simul(order=1, drop=100, periods =300, hp_filter=1600, simul_replic = 1000, irf=30) y c i d_y tb_y riskpremium r t util h k r_star lna;