# Standard deviation in theoretical moment table

Dear all,

I was trying to replicate the Hansen’s indivisible labor model (1985) but for some reasons the standard deviation of in my theoretical moment tables are way off. If possible, please have a look on the code and let me know if I make errors in the code.

Many thanks and best regards,
David

Code:
// One country RBC model with Hansen indivisible labour

var y_h c_h i_h k_h h_h r_h lambda_h;
varexo e_h;

parameters DELTA THETA BETA A H B GEMMA SIGMA_E_H;
DELTA = 0.025;
THETA = 0.36;
BETA = 0.99;
A = 2;
H = 7/12;
B = A*(log(1-H))/H;
// Parameters for the exogenous shocks VAR(1) model
GEMMA = 0.95;
SIGMA_E_H = 0.007;

H_h_bar = (-1)(1-THETA)/(B(1-(DELTATHETABETA)/(1-BETA*(1-DELTA))));
K_h_bar = ((THETA/(1/BETA-1+DELTA))^(1/(1-THETA)))H_h_bar;
I_h_bar = DELTA
K_h_bar;
Y_h_bar = (K_h_bar^THETA)H_h_bar^(1-THETA);
C_h_bar = Y_h_bar - I_h_bar;
R_h_bar = THETA
Y_h_bar/K_h_bar;

model;
// capital accumulation process
exp(k_h) = exp(k_h(-1))(1-DELTA) + exp(i_h);
// production function
exp(y_h) = exp(lambda_h)
(exp(k_h(-1))^THETA)(exp(h_h)^(1-THETA));
// budget constraint
exp(i_h) = exp(y_h) - exp(c_h);
// rate of return on capital
exp(r_h) = THETA
exp(y_h)/exp(k_h(-1));
// rearrange from FOC ht – Intratemporal condition
exp(c_h) = -(1-THETA)exp(y_h)/(Bexp(h_h));
// rearrange from FOC kt+1 – intertemporal condition
exp(r_h(+1)) = (1/BETA)exp(c_h(+1))/exp(c_h)-1+DELTA;
// technology shock process
lambda_h = GEMMA
lambda_h(-1) + e_h;
end;

initval;
y_h = log(Y_h_bar);
c_h = log(C_h_bar);
i_h = log(I_h_bar);
h_h = log(H_h_bar);
k_h = log(K_h_bar);
r_h = log(R_h_bar);
lambda_h = 1;
e_h = 0;
end;

shocks;
var e_h = SIGMA_E_H^2;
end;

resid(1);

//stoch_simul(order=1,hp_filter=1600,irf=0) y_h c_h;
stoch_simul(order=1,hp_filter=1600,irf=60) ;