burnside_k_order.mod: fix logic of test and compare Fortran and C++ routines

Also decreases approximation order for speedup
pac-components
Johannes Pfeifer 2021-10-09 12:08:16 +02:00
parent 733ffdf3ab
commit cd43c8669b
1 changed files with 6 additions and 2 deletions

View File

@ -53,7 +53,7 @@
*/
@#define k = 9
@#define k =7
var y x;
varexo e;
@ -143,7 +143,11 @@ seed = options_.DynareRandomStreams;
tStart1 = tic; fortran_endo_simul = k_order_simul(order, nstat, npred, nboth, nfwrd, nexog, ystart, ex_, ysteady, dr); tElapsed1 = toc(tStart1);
tStart2 = tic; dynare_endo_simul = dynare_simul_(order, nstat, npred, nboth, nfwrd, nexog, ystart,ex_,vcov,seed, ysteady, dr); tElapsed2 = toc(tStart2);
if (max(abs(oo_.endo_simul-fortran_endo_simul(oo_.dr.order_var,2:end))) > 1e-10)
if max(max(abs(oo_.endo_simul-fortran_endo_simul(oo_.dr.order_var,2:end)))) > 1e-10
error('Error in k_order_simul: inaccurate simulation');
end;
if max(max(abs(dynare_endo_simul-fortran_endo_simul))) > 1e-10
error('Error in k_order_simul: inaccurate simulation');
end;