%Model Description+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This is a standard RBC model with and endogenous leisure choice.



%Model Information+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Name = Leisure RBC model;



%Parameters++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#Physical Capital Share
rho	= 0.36;
#Physical Capital depreciation
delta	= 0.025;
#Gross Real Interest Rate
R_bar	= 1.01;
#Utility parameter
eta	= 1.0;
#Autocorrelation shock 
psi	= 0.95;
#Steady State of Shock
z_bar	= 1.0;
# Standard Deviation Shock
sigma_eps = 0.0712;
# Utility parameter leisure
l_bar	= 1.0/3.0; 


%Variable Vectors+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[1]  k(t):capital{endo}[log,hp]
[2]  c(t):consumption{con}[log,hp]
[4]  l(t):labour{con}[log,hp]
[5]  lam(t):lambda{con}[log,hp]
[5]  z(t):eps(t):productivity{exo}[log,hp]
[6]  @inv(t):investment[log,hp]
[7]  @w(t):wage[log,hp]
[8]  @R(t):interest[log,hp]
[9]  @y(t):output[log,hp]
[8]  @R2(t):rrate2[log,hp]
[8]  @R3(t):rrate3[log,hp]
[8]  @R4(t):rrate4[log,hp]
[8]  @R5(t):rrate5[log,hp]
[8]  @R6(t):rrate6[log,hp]
[8]  @R20(t):rrate20[log,hp]
[6]  @Div(t):divd[log,hp]


%Boundary Conditions++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
None


%Variable Substitution Non-Linear System++++++++++++++++++++++++++++++++++++++++++++++++
# Investment
[1]   @inv(t) = k(t)-(1-delta)*k(t-1);
# Production Function
[2]   @F(t) = z(t)*k(t-1)**(rho)*l(t)**(1-rho);
# Utility Function
[3]   @U(t) = c(t)**(1-eta)*(1-l(t))**(A*(1-eta))/(1-eta);
# Marginal Utility wrt consumption
[4]   @MUc(t) = DIFF{@U(t),c(t)}
# Marginal Utility wrt labour
[5]   @MUl(t) = DIFF{@U(t),l(t)}
# Wage Rate
[6]   @w(t) = DIFF{@F(t),l(t)};
# Real Interest Rate
[7]   @R(t) = 1+DIFF{@F(t),k(t-1)}-delta;
[8]   @E(t)|R(t+1) = FF_1{@R(t)};
# Output
[9]   @y(t)  = @F(t);
[10]   @R2(t) = -betta+(0.5)*eta*LOG(E(t)|c(t+2))-(0.5)*eta*LOG(c(t));
[11]   @R3(t) = -betta+(0.33)*eta*LOG(E(t)|c(t+3))-(0.33)*eta*LOG(c(t));
[12]   @R4(t) = -betta+(0.25)*eta*LOG(E(t)|c(t+4))-(0.25)*eta*LOG(c(t));
[13]   @R5(t) = -betta+(0.20)*eta*LOG(E(t)|c(t+5))-(0.20)*eta*LOG(c(t));
[14]   @R6(t) = -betta+(0.167)*eta*LOG(E(t)|c(t+6))-(0.167)*eta*LOG(c(t));
[15]   @R20(t) = -betta+(0.05)*eta*LOG(E(t)|c(t+20))-(0.05)*eta*LOG(c(t));
# dividend
[16]   @Div(t) = @y(t) - @w(t)*l(t) - @inv(t);


%Non-Linear First-Order Conditions++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Insert here the non-linear FOCs in format g(x)=0

# Market equilibrium
[1]   @y(t)-@inv(t)-c(t) = 0;
# FOC for consumption
[2]   @MUc(t)-lam(t) = 0;
# FOC for labour
[3]   @MUl(t)-lam(t)*@w(t) = 0;
# Consumption Euler
[3]   betta*E(t)|lam(t+1)*@E(t)|R(t+1)-lam(t) = 0;
# Shock Process
[4]   LOG(z(t))-psi*z(t-1) = 0;


%Steady States [Closed Form]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

R2_bar = betta**(-1);
R3_bar = betta**(-1);
R4_bar = betta**(-1);
R5_bar = betta**(-1);
R6_bar = betta**(-1);
R20_bar = betta**(-1);
inv_bar = delta*k_bar;
Div_bar = y_bar - w_bar*l_bar - inv_bar;

%Steady State Non-Linear System [Manual]+++++++++++++++++++++++++++++++++++++++++++++++++
[1]   z_bar*k_bar**(rho)*l_bar**(1-rho)-delta*k_bar-c_bar = 0;
[2]   rho*z_bar*k_bar**(rho-1)*l_bar**(1-rho)+(1-delta)-R_bar = 0;
[3]   betta*R_bar-1 = 0;
[4]   (1-rho)*z_bar*k_bar**(rho)*l_bar**(-rho)-w_bar = 0;
[5]   z_bar*k_bar**(rho)*l_bar**(1-rho)-y_bar = 0;
[6]   c_bar**(-eta)*(1-l_bar)**(A*(1-eta))-lam_bar = 0;
[7]   A*c_bar**(1-eta)*(1-l_bar)**(A*(1-eta)-1)-lam_bar*w_bar = 0;

[1]  c_bar   = 1.0;
[2]  k_bar   = 1.0;
[3]  y_bar   = 1.0;
[4]  w_bar   = 1.0;
[5]  A       = 1.0;
[6]  lam_bar = 1.0;
[7]  betta   = 1.0;

%Log-Linearized Model Equations++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
None


%Variance-Covariance Matrix++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Sigma = [sigma_eps**2];


%End Of Model File+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
