%Model Description++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Standard RBC model taken from Chapter 5 of Advanced Macroeconommics by David
Romer.

The model is able to replicate a key stylised fact of business cycles, namely 
the relative volatilities of consumption, output, and investment. Over the 
business cycle investment tends to be far more volatile than output, and output 
tends to be more volatile than consumption and this model is able to replicate 
this feature of the data.  However, the only reason the model is able to match 
this key feature of the data is because the exogenous productivity (and 
government spending shocks) are assumed to be highly persistent.  Such large and
persistent shocks to productivity/technology are hard to identify in the data.
 
Model suffers from other issues common to RBC models, for examples the model has
no room for involuntary unemployment.  In this model, workers  choose to be 
unemployed (or under employed!): workers optimally adjust their labor supply 
across time in response to changes in the real wage (which in turn are driven by
exogenous productivity/technology shocks).      

Note that there are two sources of growth in Romer's RBC: technology growth and 
population growth. Thus we will need to detrend variables accordingly in order 
to have a stationary model.  Below I work with per effective worker variables 
unless otherwise noted.

%Model Information++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Name = Romer's RBC model;

%Parameters+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Definition of exogenous parameters of this RBC are as follows:

# discount rate
rho = 0.01;

# weight (relative to consumption) that worker places on utility from leisure
b = 2.5;

# Household size (normalized to unity)
H = 1.0;

# growth rate of technology
g = 0.005;

# population growth rate 
n = 0.0025; 

# rate of capital depreciation
delta = 0.025; 

# capital's  share of output
alpha = 1.0/3.0;

# government spending per effective worker is chosen so that in SS government
# spending roughly is 20% of output (which matches U.S. data)
gov = 0.5774;

# persistence of technology shocks
rho_A = 0.95;

# pesistence of government spending shocks
rho_G = 0.95;

# standard deviation of technology shocks
sigma_A = 0.011;

# standard deviation of government spending shocks
sigma_G = 0.011;

z_A_bar = 1.0;
z_G_bar = 1.0;
A_bar   = 1.0;
G_bar   = 1.0;
g_bar   = gov;

%Variable Vectors+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Per capita consumption, c, and labor_supply, l, are the control variables; the
# two exogenous variables are technology, A, and government spending, G.  Both
# are driven by AR(1) processes z_A and z_G, respectively. 

[1] y(t):output{con}[log,hp]
[2] k(t):physical_capital{endo}[log,hp]
[3] L(t):leisure{con}[log,hp]
[4] N(t):labur{con}[log,hp]
[4] c(t):consumption{con}[log,hp]
[5] i(t):investment{con}[log,hp]
[6] w(t):real_wage{con}[log,hp]
[7] R(t):gross_interest_rate{con}[log,hp]
[8] A(t):technology{con}[log,hp]
[9] g(t):gov_spending{con}[log,hp]
[10] z_A(t):eps_A(t):tech_shocks{exo}[log,hp]
[11] z_G(t):eps_G(t):gov_shocks{exo}[log,hp]

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

%Variable Substitution Non-Linear System++++++++++++++++++++++++++++++++++++++++
# Following Romer, I work with per effective worker variables.
None

%Non-Linear First-Order Conditions++++++++++++++++++++++++++++++++++++++++++++++
[1] EXP(n + g) * k(t) - ((1 - delta) * k(t-1) + i(t)) = 0;
[2] y(t) - (c(t) + i(t) + g(t)) = 0;
[3] y(t) - k(t-1)**alpha = 0;
[4] 1 - L(t) - N(t) = 0;
[4] w(t) - (1 - alpha) * k(t-1)**alpha = 0;
[5] R(t) - (alpha * k(t-1)**(alpha - 1) + (1 - delta)) = 0;
[6] (1 / c(t)) - EXP(-(rho + g)) * (1 / E(t)|c(t+1)) * E(t)|R(t+1) = 0;
[7] b * c(t) * L(t) - (1 - L(t))*w(t) = 0;
[8] E(t)|A(t+1) - EXP(g + E(t)|z_A(t+1)) * A(t) = 0;
[9] E(t)|g(t+1) - EXP(n + g + E(t)|z_G(t+1)) * g(t) = 0;
[10] E(t)|z_A(t+1) - rho_A * z_A(t) = 0;
[11] E(t)|z_G(t+1) - rho_G * z_G(t) = 0;

%Steady States [Closed form]++++++++++++++++++++++++++++++++++++++++++++++++++++
None


%Steady State Non-Linear System [Manual]++++++++++++++++++++++++++++++++++++++++
USE_FOCS=[0,1,2,3,4,5,6,7];

[1]   k_bar = 35.0;
[2]   y_bar = k_bar**alpha;
[3]   w_bar = (1-alpha)*k_bar**alpha;
[4]   R_bar = (alpha*k_bar**(alpha-1)+(1- delta));
[5]   L_bar = 0.7;
[6]   N_bar = 0.3;
[7]   c_bar = 2.0;
[8]   i_bar = y_bar-c_bar-g_bar;

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

%Variance-Covariance Matrix+++++++++++++++++++++++++++++++++++++++++++++++++++++
Sigma = [sigma_A**2    0;
         0    sigma_G**2]; 

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