# Occbin: "increase maxit or check\_ahead\_periods" with very high maxit and check\_ahead\_periods

**URL:** <https://forum.dynare.org/t/occbin-increase-maxit-or-check-ahead-periods-with-very-high-maxit-and-check-ahead-periods/20245>\
**Category:** Occbin\
**Created:** [29 April 2022 15:34 UTC](https://forum.dynare.org/t/occbin-increase-maxit-or-check-ahead-periods-with-very-high-maxit-and-check-ahead-periods/20245 "2022-04-29T15:34:42Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![Jrs28](https://forum.dynare.org/letter_avatar_proxy/v4/letter/j/7bcc69/32.png) [@Jrs28](https://forum.dynare.org/u/Jrs28)\
**Post date:** [27 May 2022 08:32 UTC](https://forum.dynare.org/t/occbin-increase-maxit-or-check-ahead-periods-with-very-high-maxit-and-check-ahead-periods/20245/13 "2022-05-27T08:32:07Z")

</div>

Thank you for the revised file. Unfortunately, there are still a couple of hard errors which get thrown:

- “Make shocks the right size for the output” (setting etahat) needs to be done before all the returns, not only that first try/catch loop. The reason is that etahat naturally has two columns, and is reduced using etahat = etahat(:,2) at the very end of the function. This reduction is not done if the function returns early.

- I also sometimes get an error “Error using missing\_observations\_kalman\_filter. Assignment between unlike types is not allowed.”. This seems to be a consequence the way that regimes\_ is initialised as [] at the beginning of the function. I have replaced the line regimes=[]; with regimes=[regimes0 regimes0(end)], which seems to have fixed the issue.

---

_[View the full topic](https://forum.dynare.org/t/occbin-increase-maxit-or-check-ahead-periods-with-very-high-maxit-and-check-ahead-periods/20245)._
