# Occbin

**URL:** https://forum.dynare.org/c/occbin/32.md

[Latest](https://forum.dynare.org/latest.md) · [Categories](https://forum.dynare.org/categories.md)

---

## [About the Occbin category](https://forum.dynare.org/t/about-the-occbin-category/18921)

<div class="topic-metadata">

**Author:** [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Replies:** 0

</div>

This category is for topics related to Occbin, i.e. handling occasionally binding constraints with piecewise linear solutions.

---

## [OccBin estimation with two occasionally binding constraints](https://forum.dynare.org/t/occbin-estimation-with-two-occasionally-binding-constraints/28341)

<div class="topic-metadata">

**Author:** [@dh.murakami](https://forum.dynare.org/u/dh.murakami)\
**Replies:** 5\
**Last updated:** [8 May 2026 09:50 UTC](https://forum.dynare.org/t/occbin-estimation-with-two-occasionally-binding-constraints/28341 "2026-05-08T09:50:23Z")

</div>

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…

---

## [Speeding up OccBin Monte Carlo simulations](https://forum.dynare.org/t/speeding-up-occbin-monte-carlo-simulations/28305)

<div class="topic-metadata">

**Author:** [@Samvel](https://forum.dynare.org/u/Samvel)\
**Replies:** 1\
**Last updated:** [13 March 2026 12:47 UTC](https://forum.dynare.org/t/speeding-up-occbin-monte-carlo-simulations/28305 "2026-03-13T12:47:21Z")

</div>

I am running Monte Carlo simulations for welfare analysis in an OccBin model, with T = 1200 periods and N = 2000 simulations. In each simulation, I generate a sequence of 1200 random shocks in a separate .m file, feed th…

---

## [Occbin: IRFs virtually identical](https://forum.dynare.org/t/occbin-irfs-virtually-identical/28101)

<div class="topic-metadata">

**Author:** [@Iris777](https://forum.dynare.org/u/Iris777)\
**Replies:** 4\
**Last updated:** [25 November 2025 09:30 UTC](https://forum.dynare.org/t/occbin-irfs-virtually-identical/28101 "2025-11-25T09:30:57Z")

</div>

Dear Professor, I hope you are well. I have been trying to solve a simple model using Occbin, and generate the IRFs under both ZLB and non-ZLB. To do so, I followed the structure of your NK example in github. I have att…

---

## [NKM.mode in tests/occbin on github](https://forum.dynare.org/t/nkm-mode-in-tests-occbin-on-github/27916)

<div class="topic-metadata">

**Author:** [@jodie0399](https://forum.dynare.org/u/jodie0399)\
**Replies:** 4\
**Last updated:** [17 November 2025 09:07 UTC](https://forum.dynare.org/t/nkm-mode-in-tests-occbin-on-github/27916 "2025-11-17T09:07:52Z")

</div>

I have some quick questions regarding the script: dynare/testser/occbin/filter/NKM.mod. (1) Why the constraint is on inom instead of inmnot? In one case I found that using inom constraint gives the result that inmnot\>1…

---

## [Why impulse responses fluctuate abnormally in OBC condition](https://forum.dynare.org/t/why-impulse-responses-fluctuate-abnormally-in-obc-condition/28081)

<div class="topic-metadata">

**Author:** [@michael](https://forum.dynare.org/u/michael)\
**Replies:** 3\
**Last updated:** [13 November 2025 09:30 UTC](https://forum.dynare.org/t/why-impulse-responses-fluctuate-abnormally-in-obc-condition/28081 "2025-11-13T09:30:41Z")

</div>

Dear Prof @JPfeifer, I try to replicate Moran & Queralto’ model (2017). When shock is small, e.g. 0.05, not triggering occasionally\_binding constraint, impulse responses are normal. When shock is bigger, e.g. 0.08, trig…

---

## [dynareOBC assertion failed](https://forum.dynare.org/t/dynareobc-assertion-failed/28061)

<div class="topic-metadata">

**Author:** [@michael](https://forum.dynare.org/u/michael)\
**Replies:** 3\
**Last updated:** [27 October 2025 14:05 UTC](https://forum.dynare.org/t/dynareobc-assertion-failed/28061 "2025-10-27T14:05:56Z")

</div>

Dr holden, When I run dynareOBC, there is always a warning”incorrectly use Generate\_dynareOBCTempGetMaxArgValues (line 13)', ‘assertion failed’. I can not find the reason. Thank you for your help in advance! Best rega…

---

## [Shock decomposition with Occbin](https://forum.dynare.org/t/shock-decomposition-with-occbin/28027)

<div class="topic-metadata">

**Author:** [@ManuelG1](https://forum.dynare.org/u/ManuelG1)\
**Replies:** 1\
**Last updated:** [20 October 2025 20:09 UTC](https://forum.dynare.org/t/shock-decomposition-with-occbin/28027 "2025-10-20T20:09:14Z")

</div>

Hi, I am feeding to Occbin eight different shock sequences over 100 periods using the shocks(surprise) block, like below. I would like to obtain a shock decomposition for Y, is there a way to do this without running eigh…

---

## [DSGE ZLB and strange results](https://forum.dynare.org/t/dsge-zlb-and-strange-results/22283)

<div class="topic-metadata">

**Author:** [@chuxi](https://forum.dynare.org/u/chuxi)\
**Replies:** 3\
**Last updated:** [21 August 2025 06:29 UTC](https://forum.dynare.org/t/dsge-zlb-and-strange-results/22283 "2025-08-21T06:29:53Z")

</div>

Hello professor, I am doing a DSGE model and achieving a zero lower bound of interest rates using occbin, but when I analyze the results, a very strange problem arises. I put a negative capital shock on the model, but th…

---

## [OccBin for different regimes](https://forum.dynare.org/t/occbin-for-different-regimes/27701)

<div class="topic-metadata">

**Author:** [@MB1989](https://forum.dynare.org/u/MB1989)\
**Replies:** 4\
**Last updated:** [7 July 2025 14:59 UTC](https://forum.dynare.org/t/occbin-for-different-regimes/27701 "2025-07-07T14:59:39Z")

</div>

Hi everyone, I’m working with OccBin to implement a simple experiment in which a parameter switches values depending on whether a given variable crosses a threshold. Concretely, I allow the parameter governing investmen…

---

## [Shock selection with inversion filter](https://forum.dynare.org/t/shock-selection-with-inversion-filter/25255)

<div class="topic-metadata">

**Author:** [@al1987](https://forum.dynare.org/u/al1987)\
**Replies:** 24\
**Last updated:** [4 July 2025 12:44 UTC](https://forum.dynare.org/t/shock-selection-with-inversion-filter/25255 "2025-07-04T12:44:49Z")

</div>

Hi all, I am trying to understand how estimation works with Occbin, and I’m using Johannes’ NKM.mod file (tests/occbin/filter · master · Dynare / dynare · GitLab) as a toy example. One issue I encounter is the way Occb…

---

## [Exercise with two tax regimes](https://forum.dynare.org/t/exercise-with-two-tax-regimes/27753)

<div class="topic-metadata">

**Author:** [@Random.t](https://forum.dynare.org/u/Random.t)\
**Replies:** 1\
**Last updated:** [4 July 2025 10:34 UTC](https://forum.dynare.org/t/exercise-with-two-tax-regimes/27753 "2025-07-04T10:34:12Z")

</div>

Hi everybody, I am struggling with the OccBin tool and I cannot understand why in my model the piecewise linear dynamic overlap with the linear one for the whole response to the shock; it is a 2 sector nk model with po…

---

## [Modeling Quantity Sanctions with OccBin?](https://forum.dynare.org/t/modeling-quantity-sanctions-with-occbin/27716)

<div class="topic-metadata">

**Author:** [@siriy](https://forum.dynare.org/u/siriy)\
**Replies:** 1\
**Last updated:** [20 June 2025 06:45 UTC](https://forum.dynare.org/t/modeling-quantity-sanctions-with-occbin/27716 "2025-06-20T06:45:54Z")

</div>

Hi all, I’m working with a two-country model and exploring how to implement a quantity sanction on the Home economy. Specifically, I’m interested in restricting a variable like cF (e.g., imported consumption) to not exc…

---

## [Occbin: "increase maxit or check\_ahead\_periods" with very high maxit and check\_ahead\_periods](https://forum.dynare.org/t/occbin-increase-maxit-or-check-ahead-periods-with-very-high-maxit-and-check-ahead-periods/20245)

<div class="topic-metadata">

**Author:** [@Jrs28](https://forum.dynare.org/u/Jrs28)\
**Replies:** 18\
**Last updated:** [10 June 2025 20:07 UTC](https://forum.dynare.org/t/occbin-increase-maxit-or-check-ahead-periods-with-very-high-maxit-and-check-ahead-periods/20245 "2025-06-10T20:07:55Z")

</div>

Hello, I am receiving a persistent error when estimating a medium-scale DSGE model using Occbin. I am asked to increase check\_ahead\_periods despite already having set this to a comically high number (20000 quarters). I …

---

## [Number of equations marked static does not equal the number of equation marked dynamics](https://forum.dynare.org/t/number-of-equations-marked-static-does-not-equal-the-number-of-equation-marked-dynamics/27615)

<div class="topic-metadata">

**Author:** [@salonardes](https://forum.dynare.org/u/salonardes)\
**Replies:** 1\
**Last updated:** [21 May 2025 12:05 UTC](https://forum.dynare.org/t/number-of-equations-marked-static-does-not-equal-the-number-of-equation-marked-dynamics/27615 "2025-05-21T12:05:37Z")

</div>

Hello, I am currently implementing a quantitative easing model with incomplete markets in the spirit of Gertler and Karadi, embedded within a Two-Agent New Keynesian (TANK) framework. The structure of my model is inspir…

---

## [Unable to find steady state](https://forum.dynare.org/t/unable-to-find-steady-state/27553)

<div class="topic-metadata">

**Author:** [@AndreaFratini](https://forum.dynare.org/u/AndreaFratini)\
**Replies:** 1\
**Last updated:** [12 May 2025 14:33 UTC](https://forum.dynare.org/t/unable-to-find-steady-state/27553 "2025-05-12T14:33:55Z")

</div>

Goodmorning, I’ve been working with models of Sudden Stops which I always solved by global methods, I’m trying to replicate the model in “Approximately Right?: Global v. Local Methods for Open-Economy Models with Incompl…

---

## [Smets-Wouters model with OccBin with U.S. updated data](https://forum.dynare.org/t/smets-wouters-model-with-occbin-with-u-s-updated-data/27346)

<div class="topic-metadata">

**Author:** [@ddiaze](https://forum.dynare.org/u/ddiaze)\
**Replies:** 5\
**Last updated:** [7 May 2025 06:57 UTC](https://forum.dynare.org/t/smets-wouters-model-with-occbin-with-u-s-updated-data/27346 "2025-05-07T06:57:13Z")

</div>

Hello, I am working on updating the SW07 model without price indexation for the U.S. economy up to 2019 using the OccBin tool. I have updated the data using the Fred data following the excel file in the replication file…

---

## [Occbin and expected shocks](https://forum.dynare.org/t/occbin-and-expected-shocks/27311)

<div class="topic-metadata">

**Author:** [@Victory10](https://forum.dynare.org/u/Victory10)\
**Replies:** 2\
**Last updated:** [19 March 2025 12:24 UTC](https://forum.dynare.org/t/occbin-and-expected-shocks/27311 "2025-03-19T12:24:36Z")

</div>

Hello! I have a question regarding OccBin: why is it not possible to apply expected shocks? I noticed that the algorithm does not work in this case, whereas in perfect foresight models, both expected and unexpected shock…

---

## [Stochastic/risky steady state using occbin](https://forum.dynare.org/t/stochastic-risky-steady-state-using-occbin/27292)

<div class="topic-metadata">

**Author:** [@JamAl](https://forum.dynare.org/u/JamAl)\
**Replies:** 18\
**Last updated:** [17 March 2025 17:38 UTC](https://forum.dynare.org/t/stochastic-risky-steady-state-using-occbin/27292 "2025-03-17T17:38:08Z")

</div>

Dear All, I have a model in which the occasionally binding constraint is slack in the steady state. The model is too complex to be solved using global solutions. Can I combine a risky/stochastic steady state approach wi…

---

## [Occbin Estimation\_too many shocks have been calibrated with a zero variance](https://forum.dynare.org/t/occbin-estimation-too-many-shocks-have-been-calibrated-with-a-zero-variance/26740)

<div class="topic-metadata">

**Author:** [@mariale](https://forum.dynare.org/u/mariale)\
**Replies:** 10\
**Last updated:** [26 February 2025 20:36 UTC](https://forum.dynare.org/t/occbin-estimation-too-many-shocks-have-been-calibrated-with-a-zero-variance/26740 "2025-02-26T20:36:57Z")

</div>

Hi, I am trying to run an estimation using the inversion filter for a linearized model with OccBin. However, I am encountering the problem with shock parameterization when I setting up the shock variances, even if I cha…

---

## [Estimation of Smets and Wouters (2007) with Occbin](https://forum.dynare.org/t/estimation-of-smets-and-wouters-2007-with-occbin/27102)

<div class="topic-metadata">

**Author:** [@sgersp](https://forum.dynare.org/u/sgersp)\
**Replies:** 8\
**Last updated:** [2 March 2025 10:01 UTC](https://forum.dynare.org/t/estimation-of-smets-and-wouters-2007-with-occbin/27102 "2025-03-02T10:01:06Z")

</div>

Hi everybody, I estimated the model of Smets and Wouters (2007) with Swiss data (1991-2019), accounting for the interest rate lower bound with Occbin. For this, I have built on @jpfeifer’s replication codes for the orig…

---

## [Shock decomposition after Occbin calib\_smoother](https://forum.dynare.org/t/shock-decomposition-after-occbin-calib-smoother/27113)

<div class="topic-metadata">

**Author:** [@BDN](https://forum.dynare.org/u/BDN)\
**Replies:** 4\
**Last updated:** [1 February 2025 07:32 UTC](https://forum.dynare.org/t/shock-decomposition-after-occbin-calib-smoother/27113 "2025-02-01T07:32:14Z")

</div>

Dear Prof Pfeifer I am running this implementation of an NK model subject to the ZLB: I noticed that if I run shock\_decomposition after either of the calib\_smoother commands, the resulting shock decompositions show l…

---

## [Occbin simple model consistent ss](https://forum.dynare.org/t/occbin-simple-model-consistent-ss/27053)

<div class="topic-metadata">

**Author:** [@Adhikars](https://forum.dynare.org/u/Adhikars)\
**Replies:** 1\
**Last updated:** [17 January 2025 08:32 UTC](https://forum.dynare.org/t/occbin-simple-model-consistent-ss/27053 "2025-01-17T08:32:38Z")

</div>

Hi there, I am trying to run the occbin tool on a simple model with occasionally binding constraint on one of the factor inputs, but I am not sure how to set the steady state that’s consistent with the model. I am start…

---

## [Occasionally binding constraints of debt limit in FTPL model](https://forum.dynare.org/t/occasionally-binding-constraints-of-debt-limit-in-ftpl-model/27038)

<div class="topic-metadata">

**Author:** [@zhuzixiang](https://forum.dynare.org/u/zhuzixiang)\
**Replies:** 1\
**Last updated:** [14 January 2025 15:38 UTC](https://forum.dynare.org/t/occasionally-binding-constraints-of-debt-limit-in-ftpl-model/27038 "2025-01-14T15:38:34Z")

</div>

Dear Pro. I have written a new Keynesian model that introduces fiscal policy. I introduced the government debt limit in the model, which means that the debt to output ratio must be less than a threshold. The impulse res…

---

## [Jermann and Quadrini (2012) with OccBin](https://forum.dynare.org/t/jermann-and-quadrini-2012-with-occbin/26821)

<div class="topic-metadata">

**Author:** [@NiallPeat](https://forum.dynare.org/u/NiallPeat)\
**Replies:** 2\
**Last updated:** [18 December 2024 08:46 UTC](https://forum.dynare.org/t/jermann-and-quadrini-2012-with-occbin/26821 "2024-12-18T08:46:05Z")

</div>

Hi all, I’m attempting to solve Jermann and Quadrini (2012) where I include the case of the enforcement constraint not binding. I am using the OccBin function and want the enforcement constraint to bind in the steady st…

---

## [OBC on endogenous leverage constraint](https://forum.dynare.org/t/obc-on-endogenous-leverage-constraint/26819)

<div class="topic-metadata">

**Author:** [@ManuelG1](https://forum.dynare.org/u/ManuelG1)\
**Replies:** 0\
**Last updated:** [3 December 2024 13:28 UTC](https://forum.dynare.org/t/obc-on-endogenous-leverage-constraint/26819 "2024-12-03T13:28:58Z")

</div>

Hi, I would like to introduce an OBC on the endogenous bank leverage constraint in a simplified version of Sims and Wu (2021). I had thought that the equations to be modified (as in my pdf) when switching from binding t…

---

## [How to write the equation using occbin](https://forum.dynare.org/t/how-to-write-the-equation-using-occbin/26567)

<div class="topic-metadata">

**Author:** [@bellaQIU](https://forum.dynare.org/u/bellaQIU)\
**Replies:** 2\
**Last updated:** [22 October 2024 11:42 UTC](https://forum.dynare.org/t/how-to-write-the-equation-using-occbin/26567 "2024-10-22T11:42:26Z")

</div>

hi everyone! Thanks to Professor Jpfeifer for patiently answering questions for me every time! I want to write the following equation in dynare, st = fs \* st(-1) + fk \* kt(-1) + ef fk = 0.07 if kt(-1)\<kbar; 0.05 …

---

## [Implementing Variable Capacity Utilization with OccBin](https://forum.dynare.org/t/implementing-variable-capacity-utilization-with-occbin/26521)

<div class="topic-metadata">

**Author:** [@Emil\_Karlsen](https://forum.dynare.org/u/Emil_Karlsen)\
**Replies:** 2\
**Last updated:** [7 October 2024 11:19 UTC](https://forum.dynare.org/t/implementing-variable-capacity-utilization-with-occbin/26521 "2024-10-07T11:19:47Z")

</div>

Hi all, I am trying to implement variable capacity utilization in a two-sector “putty-clay” firm investment model in Dynare. Given a tax on capital in one of the sectors, the profit-maximizing firm might not want to uti…

---

## [Occbin error in kalman filter](https://forum.dynare.org/t/occbin-error-in-kalman-filter/26506)

<div class="topic-metadata">

**Author:** [@jfellmann](https://forum.dynare.org/u/jfellmann)\
**Replies:** 3\
**Last updated:** [4 October 2024 20:28 UTC](https://forum.dynare.org/t/occbin-error-in-kalman-filter/26506 "2024-10-04T20:28:40Z")

</div>

Hi! I’m trying to use occbin to estimate a model, but I get an error that I don’t know what it means. The complete error message is missing\_observations\_kalman\_filter:PKF failed in period 1 with: Occbin: Simulation te…

---

## [Occbin installation issue](https://forum.dynare.org/t/occbin-installation-issue/26398)

<div class="topic-metadata">

**Author:** [@arpanmsst](https://forum.dynare.org/u/arpanmsst)\
**Replies:** 1\
**Last updated:** [10 September 2024 06:45 UTC](https://forum.dynare.org/t/occbin-installation-issue/26398 "2024-09-10T06:45:10Z")

</div>

I would like to install occbin. How can I do that? Please provide me a step by step guidance.

[Next page](https://forum.dynare.org/c/occbin/32.md?page=1)
