OccBin estimation with two occasionally binding constraints

Hi everyone

I guess this is a question for @rattoma: as I understand it, while OccBin in Dynare can handle two OBCs in simulations, it is unable to run estimation with two OBCs correct? Is this a feature available in an unstable version of Dynare, or will this become a feature in an upcoming release?

Also, on this note, @cfp: can DynareOBC handle two OBCs for simulations?

Thanks!

estimation should work with both 1 and 2 constraints. there are examples of filtering with 2 constraints in the testsuite

@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?

Iโ€™m sorry for being so slow to reply. I flagged the email about this then forgot about it!

Yes DynareOBC can handle as many constraints as you want for simulation. But you cannot perform estimation with DynareOBC. (There is some extremely experimental estimation code, but I really do not recommend you use it.)

Fantastic. Thanks!!

Thanks for reporting this. I opened a ticket at ๐Ÿ› OccBin: if branch on line 217 truncates binding_constraint_new but line... (!2607) ยท Merge requests ยท Dynare / dynare ยท GitLab