2012-02-04 18:44:57 +01:00
|
|
|
@#define extended_path_version = 1
|
2011-12-21 18:54:32 +01:00
|
|
|
|
2014-01-17 12:05:46 +01:00
|
|
|
var Capital, Output, Labour, Consumption, Investment, Output1, Labour1, Consumption1, Output2, Labour2, Consumption2, Efficiency, efficiency, ExpectedTerm, LagrangeMultiplier;
|
2011-12-21 18:54:32 +01:00
|
|
|
|
|
|
|
varexo EfficiencyInnovation;
|
|
|
|
|
2012-11-07 10:02:00 +01:00
|
|
|
parameters beta, theta, tau, alpha, psi, delta, rho, effstar, sigma;
|
2011-12-21 18:54:32 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
** Calibration
|
|
|
|
*/
|
|
|
|
|
|
|
|
beta = 0.990;
|
|
|
|
theta = 0.357;
|
|
|
|
tau = 2.000;
|
|
|
|
alpha = 0.450;
|
2014-01-17 12:05:46 +01:00
|
|
|
psi = -0.200;
|
2011-12-21 18:54:32 +01:00
|
|
|
delta = 0.020;
|
2014-01-17 12:05:46 +01:00
|
|
|
rho = 0.800;
|
2011-12-21 18:54:32 +01:00
|
|
|
effstar = 1.000;
|
2012-11-07 10:02:00 +01:00
|
|
|
sigma = 0.100;
|
2011-12-21 18:54:32 +01:00
|
|
|
|
2012-11-07 10:02:00 +01:00
|
|
|
model(use_dll);
|
2011-12-21 18:54:32 +01:00
|
|
|
|
2012-11-07 10:02:00 +01:00
|
|
|
efficiency = rho*efficiency(-1) + sigma*EfficiencyInnovation;
|
2011-12-21 18:54:32 +01:00
|
|
|
|
2014-01-17 12:05:46 +01:00
|
|
|
Efficiency = effstar*exp(efficiency);
|
|
|
|
|
|
|
|
(((Consumption1^theta)*((1-Labour1)^(1-theta)))^(1-tau))/Consumption1 - beta*ExpectedTerm(1) + LagrangeMultiplier(1)*beta*(1-delta);
|
2011-12-21 18:54:32 +01:00
|
|
|
|
2014-01-17 12:05:46 +01:00
|
|
|
ExpectedTerm = ((((Consumption^theta)*((1-Labour)^(1-theta)))^(1-tau))/Consumption)*(alpha*((Output/Capital(-1))^(1-psi))+1-delta);
|
2011-12-21 18:54:32 +01:00
|
|
|
|
2014-01-17 12:05:46 +01:00
|
|
|
LagrangeMultiplier = max(0, (((Consumption^theta)*((1-Labour)^(1-theta)))^(1-tau))/Consumption - beta*ExpectedTerm(1) + LagrangeMultiplier(1)*beta*(1-delta));
|
2011-12-21 18:54:32 +01:00
|
|
|
|
2012-06-05 15:57:12 +02:00
|
|
|
((1-theta)/theta)*(Consumption1/(1-Labour1)) - (1-alpha)*(Output1/Labour1)^(1-psi);
|
2011-12-21 18:54:32 +01:00
|
|
|
|
2012-06-05 15:57:12 +02:00
|
|
|
Output1 = Efficiency*(alpha*(Capital(-1)^psi)+(1-alpha)*(Labour1^psi))^(1/psi);
|
2011-12-21 18:54:32 +01:00
|
|
|
|
2012-06-05 15:57:12 +02:00
|
|
|
Consumption2 = Output2;
|
|
|
|
|
|
|
|
((1-theta)/theta)*(Consumption2/(1-Labour2)) - (1-alpha)*(Output2/Labour2)^(1-psi);
|
|
|
|
|
|
|
|
Output2 = Efficiency*(alpha*(Capital(-1)^psi)+(1-alpha)*(Labour2^psi))^(1/psi);
|
|
|
|
|
|
|
|
Consumption = (Output1 > Consumption1)*Consumption1 + (1-(Output1 > Consumption1))*Consumption2;
|
|
|
|
|
|
|
|
Labour = (Output1 > Consumption1)*Labour1 + (1-(Output1 > Consumption1))*Labour2;
|
2012-01-23 13:59:25 +01:00
|
|
|
|
2012-06-05 15:57:12 +02:00
|
|
|
Output = (Output1 > Consumption1)*Output1 + (1-(Output1 > Consumption1))*Output2;
|
|
|
|
|
|
|
|
Capital = Output-Consumption + (1-delta)*Capital(-1);
|
|
|
|
|
|
|
|
Investment = Capital - (1-delta)*Capital(-1);
|
2011-12-21 18:54:32 +01:00
|
|
|
|
|
|
|
end;
|
|
|
|
|
2012-11-07 09:57:27 +01:00
|
|
|
// Write analytical steady state file (without globals)
|
|
|
|
options_.steadystate_flag = 2;
|
2018-06-27 17:02:13 +02:00
|
|
|
copyfile('rbcii_steady_state.m','+rbcii/steadystate.m');
|
2011-12-21 18:54:32 +01:00
|
|
|
|
|
|
|
@#if extended_path_version
|
|
|
|
|
|
|
|
shocks;
|
2012-11-07 09:57:27 +01:00
|
|
|
var EfficiencyInnovation = 1;
|
2011-12-21 18:54:32 +01:00
|
|
|
end;
|
|
|
|
|
2012-06-05 15:57:12 +02:00
|
|
|
steady(nocheck);
|
2012-02-01 12:30:33 +01:00
|
|
|
|
2012-03-08 12:52:53 +01:00
|
|
|
options_.ep.stochastic.order = 0;
|
2012-11-07 10:02:41 +01:00
|
|
|
|
2016-03-14 20:11:33 +01:00
|
|
|
ts = extended_path([], 20, [], options_, M_, oo_);
|
2012-02-01 12:30:33 +01:00
|
|
|
|
2012-03-08 12:52:53 +01:00
|
|
|
options_.ep.stochastic.order = 1;
|
2016-03-14 20:11:33 +01:00
|
|
|
ts1_4 = extended_path([], 20, [], options_, M_, oo_);
|
2019-04-18 17:32:10 +02:00
|
|
|
|
2011-12-21 18:54:32 +01:00
|
|
|
@#else
|
|
|
|
|
|
|
|
shocks;
|
|
|
|
var EfficiencyInnovation;
|
|
|
|
periods 1;
|
2012-11-07 10:02:41 +01:00
|
|
|
values -.8;
|
2011-12-21 18:54:32 +01:00
|
|
|
end;
|
|
|
|
|
2012-11-07 10:02:41 +01:00
|
|
|
steady;//(nocheck);
|
2012-02-01 12:30:33 +01:00
|
|
|
|
2013-10-09 13:06:06 +02:00
|
|
|
options_.simul.maxit = 100;
|
2012-02-01 12:30:33 +01:00
|
|
|
|
2011-12-21 18:54:32 +01:00
|
|
|
simul(periods=4000);
|
|
|
|
|
|
|
|
n = 100;
|
2012-01-23 14:47:01 +01:00
|
|
|
|
|
|
|
figure('Name','(rbcii) Investment.');
|
2011-12-21 18:54:32 +01:00
|
|
|
plot(Output(1:n)-Consumption(1:n),'-b','linewidth',2)
|
2012-01-23 14:47:01 +01:00
|
|
|
|
2012-11-07 10:03:43 +01:00
|
|
|
@#endif
|