Merge pull request #1365 from JohannesPfeifer/Octave_tests
Further adjust tolerance of Octave unit teststime-shift
commit
69306b5a82
|
@ -95,10 +95,14 @@ rplot Consumption;
|
||||||
rplot Capital;
|
rplot Capital;
|
||||||
|
|
||||||
D = load('rbc_det_results');
|
D = load('rbc_det_results');
|
||||||
|
if isoctave && options_.solve_algo==0
|
||||||
if norm(D.oo_.endo_simul - oo_.endo_simul) > 1e-8;
|
%%acount for somehow weaker convergence criterion in Octave's fsolve
|
||||||
|
tol_crit=1e-4;
|
||||||
|
else
|
||||||
|
tol_crit=1e-8;
|
||||||
|
end
|
||||||
|
if norm(D.oo_.endo_simul - oo_.endo_simul) > tol_crit;
|
||||||
disp(norm(D.oo_.endo_simul - oo_.endo_simul));
|
disp(norm(D.oo_.endo_simul - oo_.endo_simul));
|
||||||
error(sprintf('rbc_det_stack_solve_algo_7 failed with solve_algo=%u',options_.solve_algo));
|
error(sprintf('rbc_det_stack_solve_algo_7 failed with solve_algo=%u',options_.solve_algo));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@#endfor
|
@#endfor
|
|
@ -26,7 +26,13 @@ if max(max(abs(SmoothedShocks-repmat(SmoothedShocks(:,:,1),[1,1,2]))))>1e-8
|
||||||
error('SmoothedShocks do not match')
|
error('SmoothedShocks do not match')
|
||||||
end
|
end
|
||||||
|
|
||||||
if max(max(abs(SmoothedVariables-repmat(SmoothedVariables(:,:,1),[1,1,2]))))>1e-8
|
if isoctave
|
||||||
|
tol_crit=5e-6;
|
||||||
|
else
|
||||||
|
tol_crit=1e-8;
|
||||||
|
end
|
||||||
|
|
||||||
|
if max(max(abs(SmoothedVariables-repmat(SmoothedVariables(:,:,1),[1,1,2]))))>tol_crit
|
||||||
error('SmoothedVariables do not match')
|
error('SmoothedVariables do not match')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -16,9 +16,15 @@ if mean(abs(oo_.FilteredVariables.Mean.Y_obs(1:end-1)-Y_obs(2:end)'))>1e-3 ||...
|
||||||
error('Filtered Variables are wrong')
|
error('Filtered Variables are wrong')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if isoctave
|
||||||
|
tol_crit=3e-2 ;
|
||||||
|
else
|
||||||
|
tol_crit=2e-2 ;
|
||||||
|
end
|
||||||
|
|
||||||
if abs(corr(oo_.FilteredVariables.Mean.Y_obs(2:end-1)-Y_obs(3:end)',oo_.FilteredVariables.Mean.Y_obs(1:end-2)-Y_obs(2:end-1)'))>2e-2 ||...
|
if abs(corr(oo_.FilteredVariables.Mean.Y_obs(2:end-1)-Y_obs(3:end)',oo_.FilteredVariables.Mean.Y_obs(1:end-2)-Y_obs(2:end-1)'))>2e-2 ||...
|
||||||
abs(corr(oo_.FilteredVariables.Mean.P_obs(2:end-1)-P_obs(3:end)',oo_.FilteredVariables.Mean.P_obs(1:end-2)-P_obs(2:end-1)'))>2e-2 ||...
|
abs(corr(oo_.FilteredVariables.Mean.P_obs(2:end-1)-P_obs(3:end)',oo_.FilteredVariables.Mean.P_obs(1:end-2)-P_obs(2:end-1)'))>2e-2 ||...
|
||||||
abs(corr(oo_.FilteredVariables.Mean.junk2(2:end-1)-junk2(3:end)',oo_.FilteredVariables.Mean.junk2(1:end-2)-junk2(2:end-1)'))>2e-2
|
abs(corr(oo_.FilteredVariables.Mean.junk2(2:end-1)-junk2(3:end)',oo_.FilteredVariables.Mean.junk2(1:end-2)-junk2(2:end-1)'))>tol_crit
|
||||||
error('Filtered Variables are wrong')
|
error('Filtered Variables are wrong')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -31,17 +37,23 @@ if max(abs(squeeze(oo_.FilteredVariablesKStepAhead(1,1,2:end-(options_.nk-1)))-o
|
||||||
error('FilteredVariablesKStepAhead is wrong')
|
error('FilteredVariablesKStepAhead is wrong')
|
||||||
end
|
end
|
||||||
|
|
||||||
if abs(oo_.PointForecast.Mean.Y_obs(end)- y_forecast_100_periods)>5e-4 || abs(oo_.PointForecast.Mean.P_obs(end)- p_forecast_100_periods)>5e-4
|
if isoctave
|
||||||
|
tol_crit=7e-4;
|
||||||
|
else
|
||||||
|
tol_crit=5e-4;
|
||||||
|
end
|
||||||
|
|
||||||
|
if abs(oo_.PointForecast.Mean.Y_obs(end)- y_forecast_100_periods)>tol_crit || abs(oo_.PointForecast.Mean.P_obs(end)- p_forecast_100_periods)>tol_crit
|
||||||
error('Mean Point Forecasts do not match')
|
error('Mean Point Forecasts do not match')
|
||||||
end
|
end
|
||||||
if abs(oo_.PointForecast.Median.Y_obs(end)- y_forecast_100_periods)>5e-4 || abs(oo_.PointForecast.Median.P_obs(end)- p_forecast_100_periods)>5e-4
|
if abs(oo_.PointForecast.Median.Y_obs(end)- y_forecast_100_periods)>tol_crit || abs(oo_.PointForecast.Median.P_obs(end)- p_forecast_100_periods)>tol_crit
|
||||||
error('Median Point Forecasts do not match')
|
error('Median Point Forecasts do not match')
|
||||||
end
|
end
|
||||||
|
|
||||||
if abs(oo_.MeanForecast.Mean.Y_obs(end)- y_forecast_100_periods)>5e-4 || abs(oo_.MeanForecast.Mean.P_obs(end)- p_forecast_100_periods)>5e-4
|
if abs(oo_.MeanForecast.Mean.Y_obs(end)- y_forecast_100_periods)>tol_crit || abs(oo_.MeanForecast.Mean.P_obs(end)- p_forecast_100_periods)>tol_crit
|
||||||
error('Mean Mean Forecasts do not match')
|
error('Mean Mean Forecasts do not match')
|
||||||
end
|
end
|
||||||
if abs(oo_.MeanForecast.Median.Y_obs(end)- y_forecast_100_periods)>5e-4 || abs(oo_.MeanForecast.Median.P_obs(end)- p_forecast_100_periods)>5e-3
|
if abs(oo_.MeanForecast.Median.Y_obs(end)- y_forecast_100_periods)>tol_crit || abs(oo_.MeanForecast.Median.P_obs(end)- p_forecast_100_periods)>5e-3
|
||||||
error('Median Mean Forecasts do not match')
|
error('Median Mean Forecasts do not match')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue