diff --git a/matlab/dynare_estimation.m b/matlab/dynare_estimation.m
index 28f5bfc95741d202d0e9bcbb1a9a8f105cc1ce6c..b0daf28fe8e3b6467cc45787b1e107ae8dc8a077 100644
--- a/matlab/dynare_estimation.m
+++ b/matlab/dynare_estimation.m
@@ -966,7 +966,7 @@ if (~((any(bayestopt_.pshape > 0) & options_.mh_replic) | (any(bayestopt_.pshape
     oo_.FilteredVariablesKStepAhead = aK(options_.filter_step_ahead, ...
                                          i_endo_nbr,:);
     if isfield(options_,'kalman_algo')
-        if options_.kalman_algo > 4
+        if options_.kalman_algo > 2
             oo_.FilteredVariablesKStepAheadVariances = PK(options_.filter_step_ahead,i_endo_nbr,i_endo_nbr,:);
             oo_.FilteredVariablesShockDecomposition = ...
                 decomp(options_.filter_step_ahead,i_endo_nbr,:,:);