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 investment adjustment costs to take on a higher value when investment falls below its steady-state level, and a lower value when it rises above.
Key features of the setup:
- Steady state: Since adjustment costs vanish in steady state, the occasionally binding constraint should not affect the steady state itself. That is, both regimes share the same steady-state solution.
- Dynamics: One potential complication—possibly relevant to OccBin’s limitations—is that investment affects a highly persistent state variable (capital). However, changing the depreciation rate (delta) does not appear to alleviate the issue.
I’m attaching my final code (RBC_OccBin_2.mod), which implements the above mechanism using OccBin.
What is working:
- The code runs for both positive and negative shocks of size 1. To switch between the two cases, you can simply change line 117 from “values 1;” to “values -1;”.
- As expected, when the shock is positive, the piecewise linear solution coincides with the linear one. When the shock is negative, the piecewise solution shows a smaller drop in investment relative to the linear case, consistent with higher adjustment costs dampening investment responses.
What is not working:
- Sensitivity to shock magnitude: The model runs for “values -10;”, but fails for “values 10;”, returning the error:
“Occbin: Simulation did not converge – infinite loop of guess regimes.” - Sensitivity to constraint tolerance: Tightening the constraint threshold (e.g., from “.995” to “.999” in name ‘state’; bind i < steady_state(i).995; relax i >= steady_state(i).995;)
causes the model to break even for a positive shock, with the same error message as above. - Failure with stochastic simulations: If I uncomment lines 102–112 (for simulations) and comment out lines 114–122 (for impulse responses), the code fails with:
“Occbin: Simulation terminated with periodic solution (no convergence).”
This failure only arises when the shock series is large enough to occasionally activate the constraint. If the shock series is small enough that the constraint never binds, the code runs without error.
I find OccBin extremely helpful for macro modeling with regime-switching features, and I’m trying to deepen my understanding of its logic to avoid these pitfalls and extend its use to more complex settings.
Any insights on how to improve convergence in cases like this; whether threshold-type constraints with persistent state variables are fundamentally challenging for OccBin; or alternative modeling strategies to implement such logic robustly would be greatly appreciated.
Best regards,
Marco
RBC_OccBin_2.mod (2.9 KB)