Commit 944c19ab authored by MichelJuillard's avatar MichelJuillard
Browse files

fixing extended_path test case

parent ec05f302
......@@ -186,8 +186,7 @@ EXTRA_DIST = \
kalman_filter_smoother/fsdat_simul.m \
kalman_filter_smoother/fs2000a_steadystate.m \
identification/kim/kim2_steadystate.m \
ep/mean_preserving_spread.m \
ep/rbc_steadystate.m
ep/mean_preserving_spread.m
TARGETS =
......
......@@ -19,7 +19,7 @@ rho = 0.950;
effstar = 1.000;
sigma2 = 0.0001;
external_function(name=mean_preserving_spread);
external_function(name=mean_preserving_spread,nargs=2);
model(use_dll);
......@@ -27,7 +27,7 @@ model(use_dll);
efficiency = rho*efficiency(-1) + EfficiencyInnovation;
// Eq. n°2:
Efficiency = effstar*exp(efficiency-mean_preserving_spread(rho));
Efficiency = effstar*exp(efficiency-mean_preserving_spread(rho,sigma2));
// Eq. n°3:
Output = Efficiency*(alpha*(Capital(-1)^psi)+(1-alpha)*(Labour^psi))^(1/psi);
......@@ -46,6 +46,28 @@ model(use_dll);
end;
steady_state_model;
efficiency = 0;
Efficiency = effstar*exp(efficiency-mean_preserving_spread(rho,sigma2));
// Compute steady state ratios.
Output_per_unit_of_Capital=((1/beta-1+delta)/alpha)^(1/(1-psi));
Consumption_per_unit_of_Capital=Output_per_unit_of_Capital-delta;
Labour_per_unit_of_Capital=(((Output_per_unit_of_Capital/Efficiency)^psi-alpha)/(1-alpha))^(1/psi);
Output_per_unit_of_Labour=Output_per_unit_of_Capital/Labour_per_unit_of_Capital;
Consumption_per_unit_of_Labour=Consumption_per_unit_of_Capital/Labour_per_unit_of_Capital;
// Compute steady state share of capital.
ShareOfCapital=alpha/(alpha+(1-alpha)*Labour_per_unit_of_Capital^psi);
/// Compute steady state of the endogenous variables.
Labour=1/(1+Consumption_per_unit_of_Labour/((1-alpha)*theta/(1-theta)*Output_per_unit_of_Labour^(1-psi)));
Consumption = Consumption_per_unit_of_Labour*Labour;
Capital = Labour/Labour_per_unit_of_Capital;
Output = Output_per_unit_of_Capital*Capital;
ExpectedTerm = beta*((((Consumption^theta)*((1-Labour)^(1-theta)))^(1-tau))/Consumption)*(alpha*((Output/Capital)^(1-psi))+1-delta);
end;
shocks;
var EfficiencyInnovation = sigma2;
end;
......
function [ys, info] = rbc_steadystate(ys, exogenous)
% Steady state routine for rbc.mod (Business Cycle model with endogenous labour and CES production function)
% AUTHOR(S)
% stephane DOT adjemian AT univ DASH lemans DOT fr
% frederic DOT karame AT univ DASH evry DOT fr
% Output_per_unit_of_Capital = (((1/beta)-1+delta)/alpha)^(1/(1-psi));
% Consumption_per_unit_of_Capital = Output_per_unit_of_Capital - delta;
% Labour_per_unit_of_Capital = (((Output_per_unit_of_Capital/effstar)^psi-alpha)/(1-alpha))^(1/psi);
% Output_per_unit_of_Labour = Output_per_unit_of_Capital/Labour_per_unit_of_Capital;
% Consumption_per_unit_of_Labour = Consumption_per_unit_of_Capital/Labour_per_unit_of_Capital;
% SteadyStateLabour = 1/(1 + Consumption_per_unit_of_Labour/((theta*(1-alpha)/(1-theta))*(Output_per_unit_of_Labour^(1-psi))));
% SteadyStateConsumption = Consumption_per_unit_of_Labour*SteadyStateLabour;
% SteadyStateCapital = SteadyStateLabour/Labour_per_unit_of_Capital;
% SteadyStateOutput = Output_per_unit_of_Capital*SteadyStateCapital;
% ShareOfCapital = alpha/(alpha+(1-alpha)*Labour_per_unit_of_Capital^psi);
global M_
info = 0;
% Compute steady state ratios.
Output_per_unit_of_Capital=((1/M_.params(1)-1+M_.params(6))/M_.params(4))^(1/(1-M_.params(5)));
Consumption_per_unit_of_Capital=Output_per_unit_of_Capital-M_.params(6);
Labour_per_unit_of_Capital=(((Output_per_unit_of_Capital/M_.params(8))^M_.params(5)-M_.params(4))/(1-M_.params(4)))^(1/M_.params(5));
Output_per_unit_of_Labour=Output_per_unit_of_Capital/Labour_per_unit_of_Capital;
Consumption_per_unit_of_Labour=Consumption_per_unit_of_Capital/Labour_per_unit_of_Capital;
% Compute steady state share of capital.
ShareOfCapital=M_.params(4)/(M_.params(4)+(1-M_.params(4))*Labour_per_unit_of_Capital^M_.params(5));
% Compute steady state of the endogenous variables.
SteadyStateLabour=1/(1+Consumption_per_unit_of_Labour/((1-M_.params(4))*M_.params(2)/(1-M_.params(2))*Output_per_unit_of_Labour^(1-M_.params(5))));
SteadyStateConsumption=Consumption_per_unit_of_Labour*SteadyStateLabour;
SteadyStateCapital=SteadyStateLabour/Labour_per_unit_of_Capital;
SteadyStateOutput=Output_per_unit_of_Capital*SteadyStateCapital;
% Fill returned argument ys with steady state values.
ys(2)=SteadyStateOutput;
ys(4)=SteadyStateConsumption;
ys(1)=SteadyStateCapital;
ys(3)=SteadyStateLabour;
ys(5)=M_.params(8);
ys(6)=0;
ys(7)=M_.params(1)*((((SteadyStateConsumption^M_.params(2))*((1-SteadyStateLabour)^(1-M_.params(2))))^(1-M_.params(3)))/SteadyStateConsumption)* ...
(M_.params(4)*((SteadyStateOutput/SteadyStateCapital)^(1-M_.params(5)))+1-M_.params(6));
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment