//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//% RBC Model discussed in Lectures 2-4
//% John Tsoukalas
//% March 8, 2009
//% L14010
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//% Notes:
//%
//% 1. I have used the DYNARE timing convention
//% for the capital accumulation equation
//% see section 3.5.4 of Dynare User Guide
//%
//% 2. I have specified the production function
//% as Y_t = exp(Z_t)*K_t^(alpha)*N_t^(1-alpha)
//% and the shock in logs
//% z_t = rho*z_t-1 + epsilon_t
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//% PREAMBLE: DEFINE VARIABLES AND PARAMETERS
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
var y c k i n w r z;
varexo e;
parameters beta nu delta alpha rho sigma;
alpha = 0.36; // Share of capital in output
beta = 0.99; // Discount factor
delta = 0.025; // Depreciation rate
nu = 1.72; // Weight on leisure in U(C,l)
rho = 0.95; // Persistence of productivity shock
sigma = 0.007; // Volatility of productivity shock
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//% MODEL: EQUATIONS OF THE MODEL
//% WRITING THE MODEL IN EXP-LOGS FORM
//% THIS MEANS THAT c = log(C), k=log(K), etc...
//% SEE PAGE 20-21 OF THE MANUAL
//% DYNARE WILL TAKE THE TAYLOR-SERIES EXPANSIONS
//% IN LOGS
//% NOTE: THE SHOCK PROCESS IS SPECIFIED IN LOGS
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
model;
(1/exp(c)) = beta*(1/exp(c(+1)))*(1+exp(r(+1))-delta);
nu*exp(c)/(1-exp(n)) = exp(w);
exp(c)+exp(i) = exp(y);
exp(y) = exp(z)*(exp(k(-1))^alpha)*(exp(n))^(1-alpha);
exp(w) = (1-alpha)*exp(y)/exp(n);
exp(r) = alpha*exp(y)/exp(k(-1));
exp(i) = exp(k)-(1-delta)*exp(k(-1));
z = rho*z(-1) + e;
end;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//% INITIAL VALUES AND STEADY STATE
//%
//% OR, INCLUDE YOUR OWN SEPARATE FILE
//% XXX_steadystate.m AND TYPE //steady TO
//% CALL IT WITHIN THE .mod FILE
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
initval;
k = log(12.6698);
c = log(0.9186);
n = log(0.3335);
w = log(2.3706);
r = log(0.0351);
z = 0;
e = 0;
end;
steady;
check;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//% SHOCKS: DEFINE SHOCKS
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
shocks;
var e = sigma^2;
end;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//% COMPUTATION: ASK TO UNDERTAKE SPECIFIC
//% OPERATIONS
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
stoch_simul(periods=2100,order=1);