Change nonlinear solvers in some integration tests.

Trust region with block decomposition (as provided by dmperm) fails to provide
correct simulations (most likely due to the interpretation of tolf which
depends on the number and size of blocks).
trustregion
Stéphane Adjemian (Ryûk) 2022-03-25 12:12:32 +01:00
parent aa8439d4cc
commit 24d5ba0290
Signed by: stepan
GPG Key ID: 295C1FE89E17EB3C
3 changed files with 20 additions and 16 deletions

View File

@ -75,6 +75,7 @@ pac.update.expectation('pacman');
initialconditions = dseries(zeros(10, M_.endo_nbr+M_.exo_nbr), 2000Q1, vertcat(M_.endo_names,M_.exo_names));
// Simulate the model for 500 periods
options_.solve_algo = 9;
TrueData = simul_backward_model(initialconditions, 500);
TrueData.save('example1.data')

View File

@ -59,6 +59,7 @@ pac.update.expectation('pacman');
initialconditions = dseries(zeros(10, M_.endo_nbr+M_.exo_nbr), 2000Q1, vertcat(M_.endo_names,M_.exo_names));
// Simulate the model for 500 periods
options_.solve_algo = 9;
TrueData = simul_backward_model(initialconditions, 500);
TrueData.save('example2.data')

View File

@ -11,10 +11,10 @@ varexo e_x // $\varepsilon_x$
parameters alpha // $\alpha$
delta // $\delta$
s // $s$
rho_x // $\rho_x$
rho_n // $\rho_n$
EfficiencyGrowth_ss // $X^{\star}$
PopulationGrowth_ss ; // $N^{\star}$
rho_x // $\rho_x$
rho_n // $\rho_n$
EfficiencyGrowth_ss // $X^{\star}$
PopulationGrowth_ss ; // $N^{\star}$
alpha = .33;
delta = .02;
@ -25,27 +25,27 @@ EfficiencyGrowth_ss = 1.00; // Do not change this calibration
PopulationGrowth_ss = 1.00; // Do not change this calibration
model;
Efficiency = EfficiencyGrowth*Efficiency(-1);
EfficiencyGrowth/EfficiencyGrowth_ss = (EfficiencyGrowth(-1)/EfficiencyGrowth_ss)^(rho_x)*exp(e_x);
Population = PopulationGrowth*Population(-1);
PopulationGrowth/PopulationGrowth_ss = (PopulationGrowth(-1)/PopulationGrowth_ss)^(rho_n)*exp(e_n);
Output = PhysicalCapitalStock(-1)^alpha*(Efficiency*Population)^(1-alpha);
PhysicalCapitalStock = (1-delta)*PhysicalCapitalStock(-1) + s*Output;
Efficiency = EfficiencyGrowth*Efficiency(-1);
EfficiencyGrowth/EfficiencyGrowth_ss = (EfficiencyGrowth(-1)/EfficiencyGrowth_ss)^(rho_x)*exp(e_x);
Population = PopulationGrowth*Population(-1);
PopulationGrowth/PopulationGrowth_ss = (PopulationGrowth(-1)/PopulationGrowth_ss)^(rho_n)*exp(e_n);
Output = PhysicalCapitalStock(-1)^alpha*(Efficiency*Population)^(1-alpha);
PhysicalCapitalStock = (1-delta)*PhysicalCapitalStock(-1) + s*Output;
end;
d = dseries([.5 1 1 1.04 15], 2000Q1, {'Efficiency'; 'EfficiencyGrowth'; 'Population'; 'PopulationGrowth'; 'PhysicalCapitalStock'});
histval;
Efficiency(0) = .5;
EfficiencyGrowth(0) = 1;
Population(0) = 1;
PopulationGrowth(0) = 1.04;
PhysicalCapitalStock(0) = 15;
Efficiency(0) = .5;
EfficiencyGrowth(0) = 1;
Population(0) = 1;
PopulationGrowth(0) = 1.04;
PhysicalCapitalStock(0) = 15;
end;
LongRunEfficiency = d.Efficiency*d.EfficiencyGrowth^(rho_x/(1-rho_x));
LongRunPopulation = d.Population*d.PopulationGrowth^(rho_n/(1-rho_n));
LongRunEfficiencyGrowth = EfficiencyGrowth_ss;
LongRunEfficiencyGrowth = EfficiencyGrowth_ss;
LongRunPopulationGrowth = PopulationGrowth_ss;
LongRunIntensiveCapitalStock = (s/(LongRunEfficiencyGrowth*LongRunPopulationGrowth-1+delta))^(1/(1-alpha)); //LongRunEfficiencyGrowth*LongRunPopulationGrowth*
@ -54,6 +54,8 @@ T = 5*floor(log(precision)/log(max(rho_x, rho_n)));
e = dseries(zeros(T, 2), 2000Q2, {'e_x'; 'e_n'});
options_.solve_algo = 9;
simulations = simul_backward_model([], T, e);
if abs(simulations.Efficiency.data(end)-LongRunEfficiency.data)>1e-10