From 21443e0988228cc77811e180ae6e9f0cf418e927 Mon Sep 17 00:00:00 2001 From: Marco Ratto <marco.ratto@ec.europa.eu> Date: Fri, 18 Nov 2022 11:59:27 +0100 Subject: [PATCH] add consistency check of results using smoother_redux with occbin --- tests/occbin/filter/NKM.mod | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/occbin/filter/NKM.mod b/tests/occbin/filter/NKM.mod index 8c04a966e9..81b25d1d7e 100644 --- a/tests/occbin/filter/NKM.mod +++ b/tests/occbin/filter/NKM.mod @@ -319,6 +319,16 @@ varobs yg inom pi; mh_replic=0, plot_priors=0, smoother, smoother_redux, nodisplay,consider_all_endogenous,heteroskedastic_filter,filter_step_ahead=[1],smoothed_state_uncertainty); + // check consistency of smoother_redux + for k=1:M_.endo_nbr, + mer(k)=max(abs(oo_.SmoothedVariables.(M_.endo_names{k})-oo0.SmoothedVariables.(M_.endo_names{k}))); + end + if max(mer)>1.e-10 + error('smoother redux does not recover full smoother results!') + else + disp('smoother redux successfully recovers full smoother results!') + end + // use inversion filter (note that IF provides smoother together with likelihood) occbin_setup(likelihood_inversion_filter,smoother_inversion_filter); -- GitLab