Testsuite: add a test for deprecated simul command

silicon
Sébastien Villemot 2023-03-29 17:01:09 +02:00
parent ec908386b6
commit d5ee4dcb75
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
2 changed files with 47 additions and 1 deletions

View File

@ -513,7 +513,8 @@ MODFILES = \
solve_algo_12_14/purely_forward_reference.mod \
solve_algo_12_14/purely_forward_12.mod \
solve_algo_12_14/purely_forward_14.mod \
deprecated/ramsey_ex.mod
deprecated/ramsey_ex.mod \
deprecated/ramst.mod
ECB_MODFILES = \
var-expectations/1/example1.mod \
@ -1029,6 +1030,10 @@ solve_algo_12_14/purely_forward_14.o.trs: solve_algo_12_14/purely_forward_refere
estimation/conditional-likelihood/1/fs2000_estimation_conditional.m.trs: estimation/conditional-likelihood/1/fs2000_estimation_exact.m.trs
estimation/conditional-likelihood/1/fs2000_estimation_conditional.o.trs: estimation/conditional-likelihood/1/fs2000_estimation_exact.o.trs
deprecated/ramst.m.trs: simul/ramst.m.trs
deprecated/ramst.o.trs: simul/ramst.o.trs
observation_trends_and_prefiltering/MCMC: m/observation_trends_and_prefiltering/MCMC o/observation_trends_and_prefiltering/MCMC
m/observation_trends_and_prefiltering/MCMC: $(patsubst %.mod, %.m.trs, $(filter observation_trends_and_prefiltering/MCMC/%.mod, $(MODFILES)))
o/observation_trends_and_prefiltering/MCMC: $(patsubst %.mod, %.o.trs, $(filter observation_trends_and_prefiltering/MCMC/%.mod, $(MODFILES)))

View File

@ -0,0 +1,41 @@
// Tests the deprecated simul command
var c k;
varexo x;
parameters alph gam delt bet aa;
alph=0.5;
gam=0.5;
delt=0.02;
bet=0.05;
aa=0.5;
model;
c + k - aa*x*k(-1)^alph - (1-delt)*k(-1);
c^(-gam) - (1+bet)^(-1)*(aa*alph*x(+1)*k^(alph-1) + 1 - delt)*c(+1)^(-gam);
end;
initval;
x = 1;
k = ((delt+bet)/(1.0*aa*alph))^(1/(alph-1));
c = aa*k^alph-delt*k;
end;
steady;
check;
shocks;
var x;
periods 1;
values 1.2;
end;
simul(periods=200);
benchmark = load('../simul/ramst/Output/ramst_results.mat');
if max(abs(benchmark.oo_.endo_simul-oo_.endo_simul)) > 1e5
error('The results of simul are inconsistent with perfect_foresight_setup+perfect_foresight_solver');
end