| 1 |
% RBC model with irreversible investment constraint, implemented using MCP tag. |
| 2 |
|
| 3 |
var k, y, L, c, A, a, mu, i; |
| 4 |
|
| 5 |
varexo epsilon; |
| 6 |
|
| 7 |
parameters beta, theta, tau, alpha, psi, delta, rho, Astar; |
| 8 |
|
| 9 |
@#include "rbcii-calibration.inc" |
| 10 |
|
| 11 |
model(use_dll); |
| 12 |
a = rho*a(-1) + epsilon; |
| 13 |
A = Astar*exp(a); |
| 14 |
y = A*(alpha*k(-1)^psi+(1-alpha)*L^psi)^(1/psi); |
| 15 |
k = y-c + (1-delta)*k(-1); |
| 16 |
(1-theta)/theta*c/(1-L) - (1-alpha)*(y/L)^(1-psi); |
| 17 |
(c^theta*(1-L)^(1-theta))^(1-tau)/c -mu = |
| 18 |
beta*(c(+1)^theta*(1-L(+1))^(1-theta))^(1-tau)/c(+1) |
| 19 |
*(alpha*(y(+1)/k)^(1-psi)+1-delta)+mu(+1)*(1-delta); |
| 20 |
i=y-c; |
| 21 |
mu = 0 ⟂ i > 0; |
| 22 |
end; |
| 23 |
|
| 24 |
|
| 25 |
steady_state_model; |
| 26 |
a = epsilon/(1-rho); |
| 27 |
A = Astar*exp(a); |
| 28 |
Output_per_unit_of_Capital=((1/beta-1+delta)/alpha)^(1/(1-psi)); |
| 29 |
Consumption_per_unit_of_Capital=Output_per_unit_of_Capital-delta; |
| 30 |
Labour_per_unit_of_Capital=(((Output_per_unit_of_Capital/A)^psi-alpha) |
| 31 |
/(1-alpha))^(1/psi); |
| 32 |
Output_per_unit_of_Labour=Output_per_unit_of_Capital/Labour_per_unit_of_Capital; |
| 33 |
Consumption_per_unit_of_Labour=Consumption_per_unit_of_Capital |
| 34 |
/Labour_per_unit_of_Capital; |
| 35 |
% Compute steady state of the endogenous variables. |
| 36 |
L=1/(1+Consumption_per_unit_of_Labour/((1-alpha)*theta/(1-theta) |
| 37 |
*Output_per_unit_of_Labour^(1-psi))); |
| 38 |
c=Consumption_per_unit_of_Labour*L; |
| 39 |
k=L/Labour_per_unit_of_Capital; |
| 40 |
y=Output_per_unit_of_Capital*k; |
| 41 |
i=delta*k; |
| 42 |
mu=0; |
| 43 |
end; |
| 44 |
|
| 45 |
steady; |
| 46 |
|
| 47 |
shocks; |
| 48 |
var epsilon; |
| 49 |
stderr 0.10; |
| 50 |
end; |
| 51 |
|
| 52 |
set_dynare_seed(2009); |
| 53 |
extended_path(periods=200,order=0,lmmcp); |
| 54 |
|
| 55 |
if ~oo_.extended_path.status || any(Simulated_time_series.i.data<-1e-6) |
| 56 |
error('lmmcp tag did not work.') |
| 57 |
end |
| 58 |
|
| 59 |
ds = dseries('rbcii-sim-data.mat'); |
| 60 |
if isoctave |
| 61 |
tolerance=5e-5; |
| 62 |
else |
| 63 |
tolerance=1e-5; |
| 64 |
end |
| 65 |
|
| 66 |
if any(abs(Simulated_time_series.i.data-ds.Investment.data)>tolerance) |
| 67 |
error('Simulation with lmmcp returns different results.') |
| 68 |
end |
| 69 |
|
| 70 |
delete rbcii-sim-data.mat |