OCCBIN in newer Dynare versions

Hi all,

I am working on Iacoviello (2017), “Collateral Constraints and Macroeconomic Asymmetries,” and try to add a search and matching mechanism on to the impatient households (which also act as entrepreneurs/managers in Iacoviello’s model). The search and matching mechanism I adopted is a very simple one (pls see the attached), so I add 5 new endogenous variables and treat the wage of impatient households (variable w1) as a parameter. The first six equations in the model module in my Dynare core is what I added on. Due to the nonlinear equations, I could not compute the analytical steady state manually, so I turn to the initval value strategy. But the Dynare core ends up with ‘Impossible to find the steady state. Either the model doesn’t have a unique steady state of the guess values are too far from the solution’. I have tried different timing for predetermined variables and different starting values for steady states but still couldn’t solve it. I know the reason behind might be complicated. Most starting values stay the same with those in Iacoviello (2017), as I think I do not change too much. Does someone have an idea how to overcome this problem?matchingmodelp.pdf (86.6 KB) my work.mod (6.3 KB) Replication code from Iacoviello’s website.zip (6.1 KB)

I appreciate any help that you can provide.

When I run your code in Dynare 4.5.7, I get


u 0.821066
lmft 0.00653788
v 0.000165155
g 0.0215365
p 0.000754318
aj 1
ak 1
ap 1
arr 1
az 1
b 1.71697
bnot 1.71697
c 0.463378
c1 0.257497
data_ctot -0.000160347
data_dp 4.44089e-16
data_ik 0
data_ntot 0
data_q 0
data_r 6.66134e-16
data_rnot 6.66134e-16
dp 1.005
dp1 1.005
dp2 1.005
dp3 1.005
h1 0.3423
ik 0.189534
k 7.58136
lm 0.00895216
maxlev 0
n 0.75606
n1 0.178934
q 5.63635
qk 1
r 1.01005
rk 0.0300251
rnot 1.01005
uc 2.15806
uc1 3.88353
uh 0.060818
uh1 0.116856
w 0.350342
xp 1.2
y 0.910526
z_j 0

Modulus Real Imaginary

           0                0                0
           0               -0                0
           0               -0                0
   7.304e-14        7.304e-14                0
     0.04494         -0.04494                0
     0.05439          0.05439                0
      0.2759           0.2759                0
      0.5862           0.5824          0.06637
      0.5862           0.5824         -0.06637
      0.6232           0.6232                0
      0.6782          -0.6782                0
      0.6839           0.6839                0
      0.7556           0.7556                0
      0.7859           0.7859                0
      0.8875           0.8875                0
       0.905           0.9022          0.07078
       0.905           0.9022         -0.07078
       0.946            0.946                0
      0.9835           0.9835                0
       1.005            1.005                0
       1.024            1.024                0
       1.088            1.088                0
       1.101            1.098          0.08382
       1.101            1.098         -0.08382
       1.106            1.098           0.1369
       1.106            1.098          -0.1369
       1.429            1.429                0
       1.472            1.472                0
    3.65e+15         3.65e+15                0
         Inf              Inf                0
         Inf              Inf                0
         Inf              Inf                0
         Inf              Inf                0
         Inf              Inf                0

There are 15 eigenvalue(s) larger than 1 in modulus
for 16 forward-looking variable(s)

The rank condition ISN’T verified!

Error using print_info (line 45)
Blanchard Kahn conditions are not satisfied: indeterminacy

So a steady state is found, but the timing is most probably wrong.

Dear Johannes,

Thank you so much for your response. I’ve fixed the timing problem, now the mod file can be run under Dynare 4.5.6 and 4.5.7 versions, but not under 4.3.1. As I want to apply the Iacoviello’s occbin toolkit, a new problem arisen is the toolkit for two constraints does not work under Dynare 4.5.6. I have tried Iacoviello’s original codes, they are also incompatible with Dynare 4.5.6, but the difference is his single mod file can be run under 4.3.1, so the whole occbin can be run under 4.3.1. Under 4.5.6, the error is ‘Reference to non-existent field ‘nstatic’. The error is located in one toolkit file ‘get_pq’, there is dr_.nstatic. Do you have an idea how to solve it?

Many thanks for your help!

In such cases, please provide the full error message and the code where it occurs. From what I can see, the problem comes from Dynare moving the model information like the number of static variables from the decision rule structure oo_.dr. to the model structure M_. So you need to replace this occurrence with M_.nstatic

Dear Johannes,

Many thanks for your advice. I have tried the M_.nstatic, but it still does not work. I paste the error message and code in the attachment ‘error’. Another attachment is the full set code I tried, I first run the ‘setpathdynare4.m’ to set path (linked to 4.5.6 or 4.3.1), and then run the m file ‘runsim_plot_figure3 ’. Then the error occurs. replication_figure3_4 - w1 - initval2.zip (1.5 MB) error.zip (57.8 KB)

The four mod files, baby00, baby01, baby10, baby11, are for the setup of two constraints, relaxing or binding. The single mod file, baby00 can be run under 4.5.6.

I really appreciate all your help.

Please try the modified Occbin toolkit files
toolkit_files_4.5.zip (20.1 KB)

Thank you so much, Johannes. It works now!

Hi professor Pfeifer:

Hope this message finds you well. I am using the modified Occbin toolkit under dynare 4.6.1, running a simple three equation NK model. And the code is downloaded from https://github.com/lucaguerrieri/occbin. and the code attached:

runsim_cgg.m (2.4 KB) cgg.mod (767 Bytes) cgg_zlb.mod (517 Bytes)

However, when i run it it reports:

Error using eval
Must be a string scalar or character vector.

Error in solve_one_constraint (line 44)
eval([Mbase_.param_names(i_indx_,:),’= M_.params(i_indx_);’]);

Error in runsim_cgg (line 45)

Error in run (line 91)
evalin(‘caller’, strcat(script, ‘;’));

I guess it’s still because of the occbin is not adaptable to new version dynare. May i know where i can get the new modified version occbin or how to modify it?

Thanks a lot!

I have created a GIT repository for maintaining inofficial updated versions at

1 Like