@rattoma I was struggling with submitting the following bug report for OccBin.solve_two_constraints:
▎ Title: occbin.solve_two_constraints line 237: dimension mismatch when max_check_ahead_periods is finite
▎
▎ Version: Dynare 7.0
▎
▎ File: matlab/+occbin/solve_two_constraints.m, line 237
▎
▎ Bug: When opts_simul_.max_check_ahead_periods < length(binding_indicator), the if branch on line 217 truncates binding_constraint_new
▎ (line 224) and my_binding_indicator (line 226) to length 2*end_periods. Lines 232–234 correctly use the truncated
▎ my_binding_indicator(:) for the regime-change check. But line 237 references the un-truncated binding_indicator(:) (length
▎ 2*(nperiods_0+1)), so the & operator throws Arrays have incompatible sizes.
▎
▎ Fix: Change binding_indicator(:) → my_binding_indicator(:) on line 237.
▎
▎ Sibling for reference: solve_one_constraint.m:212 does the equivalent comparison correctly with truncated arrays on both sides.
▎
▎ Reproducer: any 2-constraint OccBin model run through likelihood_piecewise_kalman_filter with a finite
▎ options_.occbin.likelihood.max_check_ahead_periods smaller than the binding horizon.
Maybe you or @jpfeifer could submit this report and look into it?