Removing debugging code for extended path. Updating test cases.
parent
dc7c0fa74d
commit
ec05f302b7
|
@ -193,8 +193,8 @@ function [flag,endo_simul,err] = solve_stochastic_perfect_foresight_model(endo_s
|
|||
end
|
||||
flag = 0;% Convergency obtained.
|
||||
endo_simul = reshape(Y(:,1),ny,periods+2);%Y(ny+(1:ny),1);
|
||||
figure;plot(Y(16:ny:(periods+2)*ny,:))
|
||||
pause
|
||||
% figure;plot(Y(16:ny:(periods+2)*ny,:))
|
||||
% pause
|
||||
break
|
||||
end
|
||||
dy = -A\res;
|
||||
|
|
|
@ -126,6 +126,7 @@ MODFILES = \
|
|||
second_order/ds1.mod \
|
||||
second_order/ds2.mod \
|
||||
ep/rbc.mod \
|
||||
ep/rbcii.mod \
|
||||
ep/linear.mod \
|
||||
deterministic_simulations/deterministic_model_purely_forward.mod \
|
||||
deterministic_simulations/rbc_det1.mod \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
function m = mean_preserving_spread(autoregressive_parameter)
|
||||
function m = mean_preserving_spread(autoregressive_parameter,sigma)
|
||||
% Computes the mean preserving spread for first order autoregressive process.
|
||||
%
|
||||
% The mean preserving spread m is a constant such that the mean of the process
|
||||
|
@ -13,6 +13,5 @@ function m = mean_preserving_spread(autoregressive_parameter)
|
|||
% AUTHOR(S)
|
||||
% stephane DOT adjemian AT univ DASH lemans DOT fr
|
||||
% frederic DOT karame AT univ DASH evry DOT fr
|
||||
global M_
|
||||
|
||||
m = M_.Sigma_e/(1-autoregressive_parameter*autoregressive_parameter);
|
||||
m = sigma/(1-autoregressive_parameter*autoregressive_parameter);
|
|
@ -57,10 +57,10 @@ options_.ep.stochastic.nodes = 2;
|
|||
options_.console_mode = 0;
|
||||
|
||||
options_.ep.stochastic.order = 0;
|
||||
ts0 = extended_path([],100);
|
||||
//ts0 = extended_path([],100);
|
||||
|
||||
options_.ep.stochastic.order = 1;
|
||||
ts1 = extended_path([],100);
|
||||
//ts1 = extended_path([],100);
|
||||
|
||||
options_.ep.stochastic.order = 2;
|
||||
ts2 = extended_path([],100);
|
||||
|
|
|
@ -26,15 +26,15 @@ sigma2 = 0.001;
|
|||
rho = 0.800;
|
||||
@#endif
|
||||
|
||||
external_function(name=mean_preserving_spread);
|
||||
external_function(name=mean_preserving_spread,nargs=2);
|
||||
|
||||
model(use_dll);
|
||||
model;
|
||||
|
||||
// Eq. n°1:
|
||||
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);
|
||||
|
@ -56,6 +56,27 @@ 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;
|
||||
Investment = delta*Capital;
|
||||
ExpectedTerm = beta*((((Consumption^theta)*((1-Labour)^(1-theta)))^(1-tau))/Consumption)*(alpha*((Output/Capital)^(1-psi))+1-delta);
|
||||
end;
|
||||
|
||||
@#if extended_path_version
|
||||
|
||||
|
|
Loading…
Reference in New Issue