%/* Y shows output, c consumption, k capital, i investment, l is labor, h working hour, psi shows B/Z = 2,67/0,74 = 0,277 */


%/* VARIABLES*/
var Y L C I W K ly lh lc li lw lk z ;
varexo e;

parameters beta, fi, alpha, delta, psi, ze;

alpha = 0.36;
beta = 0.99;
delta = 0.024;
rho = 0.95;
sigma = 0.09;
psi = 0.277;
ze = 1;

/* Steady states*/
/*
rr=1/beta-1;
zss = 1;
css=(1-alpha)*(zss/psi)*(alpha*zss/(rr+delta))^(alpha/(1-alpha));
kss=css/((rr+delta)/alpha-delta);
yss=ze*(kss^(alpha))*(L^(1-alpha));
iss=delta*kss;
wss=(1-alpha)*yss/L;
*/
/* MODEL*/

model;

(1/beta)*C(+1)/C=alpha*Y(+1)/K+1-delta; /* Euler equation*/
psi*C=(1-alpha)*Y/L; /*labor market eq.*/
Y = C + K - (1-delta)*K(-1); /*Resource constraint*/
Y = exp(z)*K(-1)^alpha*L^(1-alpha); /* production function*/
I=Y-C;
W=(1-alpha)*Y/L; /* real wages*/
z=fi*z(-1)+e; /*theta-shock follows this process -law of motion*/

/*log transformations of end. variables*/
ly=log(Y);
lh=log(L);
lc=log(C);
li=log(I);
lw=log(W);
lk=log(K);
end;



/*i found some initial values from other examples in dynare, but i am not sure if they fits on with theory or not*/
initval;
Y = 1.08068253095672;
C = 0.80359242014163;
L = 0.29175631001732;
K = 11.08360443260358;
I = 1.2;
W = 2.07;
e = 0;
end;

shocks;
var e; 
stderr 0.009;
end;

stoch_simul;