# Problem with OCCBIN

**URL:** <https://forum.dynare.org/t/problem-with-occbin/19727>\
**Category:** Occbin\
**Created:** [1 February 2022 16:24 UTC](https://forum.dynare.org/t/problem-with-occbin/19727 "2022-02-01T16:24:38Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![marazi](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@marazi](https://forum.dynare.org/u/marazi)\
**Post date:** [1 February 2022 16:24 UTC](https://forum.dynare.org/t/problem-with-occbin/19727/1 "2022-02-01T16:24:38Z")

</div>

Hello, i am trying to run the code for the paper of Sims and Wu (2020 JME) “The Central Bank Toolkit”. I can run it without problem for the case of no ZLB binding.

But when it is occasionally binding, and I have to call OCCBIN toolkit, I have the following problem:

Error using eval  
Must be a text scalar.

Error in solve\_one\_constraint (line 44)  
eval([Mbase\_.param\_names(i\_indx\_,:),’= M\_.params(i\_indx\_);’]);

When running the first simulation

[sim\_MP] = …  
solve\_one\_constraint(modnam,modnamstar,…  
constraint, constraint\_relax,…  
baseline,irfshock,nperiods,maxiter);

I have tried with every version of OCCBIN (found 3) + 5 versions of Dynare, and I always get that problem.

I attach the .mod and matlab files, that are in Sims website.  
[execute\_sw2020\_zlb.m](https://forum.dynare.org/uploads/short-url/hZKbfgBz3dHncRRC1SQS92gs5m0.m) (11.9 KB)  
[sw2020\_zlb.mod](https://forum.dynare.org/uploads/short-url/twZrS1SaMNwoaaUKvVE2Ptg1ovD.mod) (7.7 KB)

Thank you.

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [1 February 2022 16:40 UTC](https://forum.dynare.org/t/problem-with-occbin/19727/2 "2022-02-01T16:40:31Z")

</div>

Where did you get the different Occbin versions from? The master-branch at [GitHub - JohannesPfeifer/Occbin\_update](https://github.com/JohannesPfeifer/Occbin_update) should be compatible with 4.6 for example. You also did not provide the `sw_2020.mod` for the baseline case.

---

<div class="post-metadata">

**Author:** ![marazi](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@marazi](https://forum.dynare.org/u/marazi)\
**Post date:** [1 February 2022 17:13 UTC](https://forum.dynare.org/t/problem-with-occbin/19727/3 "2022-02-01T17:13:04Z")

</div>

Now I tried with the updated version you provided and get this error. Seems I will have to try for different parameter values. I attach the baseline scenario mod + matlab. I used dynare 5.0 + updated OCCBIN you provided.  
[execute\_sw2020.m](https://forum.dynare.org/uploads/short-url/wcfWS2IXBk0NMItP389ihBZSbfC.m) (6.7 KB)  
[sw\_2020.mod](https://forum.dynare.org/uploads/short-url/aNQMolXjklxXiKz1id4qwDYQdBn.mod) (7.8 KB)

Error using print\_info (line 32)  
Impossible to find the steady state (the sum of square residuals of the static equations is  
0.9125). Either the model doesn’t have a steady state, there are an infinity of steady states, or  
the guess values are too far from the solution

Error in steady (line 102)  
print\_info(info,options\_.noprint, options\_);

Error in sw2020\_zlb.driver (line 797)  
steady;

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [1 February 2022 17:59 UTC](https://forum.dynare.org/t/problem-with-occbin/19727/4 "2022-02-01T17:59:20Z")

</div>

Are you maybe missing their steady state file?

---

<div class="post-metadata">

**Author:** ![marazi](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@marazi](https://forum.dynare.org/u/marazi)\
**Post date:** [1 February 2022 19:12 UTC](https://forum.dynare.org/t/problem-with-occbin/19727/5 "2022-02-01T19:12:18Z")

</div>

I don’t think so. Those are the 4 files. Thank you.

---

<div class="post-metadata">

**Author:** ![Max1](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/e99b99/32.png) [@Max1](https://forum.dynare.org/u/Max1)\
**Post date:** [1 February 2022 19:20 UTC](https://forum.dynare.org/t/problem-with-occbin/19727/6 "2022-02-01T19:20:09Z")

</div>

If you mean the Sims & Wu (2021) paper with the title “Evaluating Central Banks’ tool kit: Past, present, and future”, I can help you out.  
I replicated all figures in that paper some time ago under Dynare 4.6.4.

---

<div class="post-metadata">

**Author:** ![marazi](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@marazi](https://forum.dynare.org/u/marazi)\
**Post date:** [1 February 2022 19:37 UTC](https://forum.dynare.org/t/problem-with-occbin/19727/7 "2022-02-01T19:37:10Z")

</div>

Thank you Max! I can replicate everything under the non-ZLB case.

My problem is that (using both 4.6.4 until 5.0 versions) I always have problems with steady state.

Can you share your .mod and matlab files for the ocasionally binding ZLB constraints?

Thank you

---

<div class="post-metadata">

**Author:** ![Max1](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/e99b99/32.png) [@Max1](https://forum.dynare.org/u/Max1)\
**Post date:** [1 February 2022 20:18 UTC](https://forum.dynare.org/t/problem-with-occbin/19727/8 "2022-02-01T20:18:18Z")

</div>

Under Windows with Dynare 4.6.4 installed under` 'C:/dynare/4.6.4/matlab'`  
you only have to call the respective main files to replicate the desired figure from Sims & Wu (2021).

The files are just an updated version of the replication codes from the Homepage of Jing Cynthia Wu.  
The design of the code changed a bit because I take advantage of some of Dynares capabilities.  
I will send the files via PM.

---

<div class="post-metadata">

**Author:** ![Avery66676](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@Avery66676](https://forum.dynare.org/u/Avery66676)\
**Post date:** [24 June 2022 16:57 UTC](https://forum.dynare.org/t/problem-with-occbin/19727/9 "2022-06-24T16:57:35Z")

</div>

Hello Dr. Pfeifer,

I have used your updated Occinbin toolkit in dynare 4.6.4. I have got steady state result but I also got the error as follow:

Unrecognized field name “ys”.  
Error in solve\_one\_constraint (line 49)  
eval([Mbase\_.endo\_names{i,:} '_ss = oobase_.dr.ys(i); ']);  
Error in runsim (line 38)  
solve\_one\_constraint(modnam,modnamstar,…

Could you please let me know what the problem is? Thank you!

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [26 June 2022 07:51 UTC](https://forum.dynare.org/t/problem-with-occbin/19727/10 "2022-06-26T07:51:22Z")

</div>

Given that we now ship OccBin with Dynare 5, please try that one.

---

<div class="post-metadata">

**Author:** ![Avery66676](https://forum.dynare.org/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@Avery66676](https://forum.dynare.org/u/Avery66676)\
**Post date:** [26 June 2022 20:17 UTC](https://forum.dynare.org/t/problem-with-occbin/19727/11 "2022-06-26T20:17:03Z")

</div>

Thank you very much for your reply. I am using Dynare 5.1 now. But since I am having more than one shocks and I want to plot simulations to all these shocks with and without ZLB bindings, I don’t know how to structure the ‘shocks(surprise)’ block.

[usdsge.mod](https://forum.dynare.org/uploads/short-url/6mSJuHZjQBj0NjSHYHJZytFeO4K.mod) (11.5 KB)

---

<div class="post-metadata">

**Author:** ![chuxi](https://forum.dynare.org/letter_avatar_proxy/v4/letter/c/3e96dc/32.png) [@chuxi](https://forum.dynare.org/u/chuxi)\
**Post date:** [1 April 2023 05:19 UTC](https://forum.dynare.org/t/problem-with-occbin/19727/12 "2023-04-01T05:19:58Z")

</div>

Hi, sorry to disturb you.I’m doing the DSGE model with ZLB,and I want to examine the effct of the combination of two shocks.Now I meet the same problem with you,have your problem solved? If so,may I plea you to share some experience with me？

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [3 April 2023 13:59 UTC](https://forum.dynare.org/t/problem-with-occbin/19727/13 "2023-04-03T13:59:54Z")

</div>

It seems you have solved your own problem in

> [@ZLB implemention and occbin\_constraints](https://forum.dynare.org/t/zlb-implemention-and-occbin-constraints/22173/30):
>
> Dear professor,thanks for your reminder,I have solved my problems by the shock(surprise).Wish you all the best！

---

<div class="post-metadata">

**Author:** ![chuxi](https://forum.dynare.org/letter_avatar_proxy/v4/letter/c/3e96dc/32.png) [@chuxi](https://forum.dynare.org/u/chuxi)\
**Post date:** [4 April 2023 03:10 UTC](https://forum.dynare.org/t/problem-with-occbin/19727/14 "2023-04-04T03:10:21Z")

</div>

Yes. Finally I got it .Thanks for your help.

---

<div class="post-metadata">

**Author:** ![Daria](https://forum.dynare.org/letter_avatar_proxy/v4/letter/d/13edae/32.png) [@Daria](https://forum.dynare.org/u/Daria)\
**Post date:** [7 September 2024 16:02 UTC](https://forum.dynare.org/t/problem-with-occbin/19727/15 "2024-09-07T16:02:45Z")

</div>

Hello Max,

May I ask you to share the advanced code for the paper with me as well?

Kind regards,  
Daria

---

<div class="post-metadata">

**Author:** ![Max1](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/e99b99/32.png) [@Max1](https://forum.dynare.org/u/Max1)\
**Post date:** [7 September 2024 21:01 UTC](https://forum.dynare.org/t/problem-with-occbin/19727/16 "2024-09-07T21:01:15Z")

</div>

See my pm.
