OLG model with multiple occasionally binding constraints

Hello everyone,

I’m trying to replicate the following paper “A Model of Secular Stagnation: Theory and Quantitative Evaluation By Gauti B. Eggertsson, Neil R. Mehrotra, and Jacob A. Robbins” available at https://pubs.aeaweb.org/doi/pdfplus/10.1257/mac.20170367.

It is a 56-generations OLG model with occasionally binding constraints over asset accumulation. On page 32 there are j occasionally binding constraints (one for each generation j) of the form:
a{j} >= D/(1+r) for j=1…56
where a{j} is the asset of the jth generation, D a parameter, and r is a price.

I checked the possible solution to get the steady-state using occBin toolkit from Guerrieri and Iacoviello, but I saw that it handles max 2 occasionally binding constraints, then it doesn’t fit my problem which has j=56 obcs.

Does somebody have some hints?

Many thanks,

Alex Crescentini.

The paper only studies steady state transitions in a perfect foresight context. Thus, setting up a mcp-problem may work. See e.g. DSGE_mod/Gali_2015_chapter_5_discretion_ZLB.mod at master · JohannesPfeifer/DSGE_mod · GitHub

Thanks for the advice, I will try it. However, the authors in their Matlab code also calculate the steady-states separately, the initial in 1970 and the final in 2015, and then they also do the transition in a perfect foresight.

I want to calculate just the steady-state 2015 and not the transitional dynamics, so If i got into this, i need to set up my mcp tags in the model equations, and then use steady(solve_algo=10) which uses the Levenberg-Marquardt mixed complementarity problem (LMMCP) solver, is it right?


Update: using steady(solve_algo=10) i’m getting the following error: Reference to non-existent field ‘lb’, I don’t know why.

I attached the code.

alex_9_mcp.mod (8.8 KB)
data_hc.xlsx (9.5 KB)
data_survival_1_2015.xlsx (9.4 KB)
data_survival_1.xlsx (9.4 KB)
data_survival_2_2015.xlsx (9.5 KB)
data_survival_2.xlsx (9.4 KB)
data_uncondit_survival_2015.xlsx (9.8 KB)
data_uncondit_survival.xlsx (9.8 KB)

Unfortunately, this is not feasible yet. First of all, steady state computations do not work with mcp yet. See Implement option to use LMMCP for steady state computation (#1664) · Issues · Dynare / dynare · GitLab
Second, and potentially more problematic is that your constraint seems to depend on endogenous objects. The current implementation of Dynare only handles numerical values on the RHS of your constraint. But in your case,


involves various objects that need to be solved for.

1 Like

I was wondering, If I use steady(solve_algo=11) which I saw that uses the lmmcp solver and allows the mcp tag to be used, and I re-write the constraint as a@{j}*(1+r)>D, should be potentially right?

Thank you,

Not really. It’s not straightforward to get this to work. Part of the changes necessary are in Draft: Provisions for solving steady state with MCP-tag (!1877) · Merge requests · Dynare / dynare · GitLab

The mod-file also required some workarounds, introducing a*(1+r) as a separate variable and replacing D by its numerical value:
alex_9_mcp.mod (9.0 KB)

But it still does not work as expected.

I forgot to reply months ago, but I did a workaround using the min function as in pag. 7,8 and 15 of Occasionally Binding Constraints in Large Models: A Review of Solution Methods - Bank of Canada and it works.

Maybe it’s useful for others.


Hey Alex,

Just wondering whether you could share your final codes for the community.


Sorry for the late reply @bhatiyali. For those interested, we wrote a replication paper, forthcoming in a special issue between I4R and Economic Inquiry, called “On the Reproducibility and Replicability in Economics”. The working paper can be found here: Dynare replication of "A Model of Secular Stagnation: Theory and Quantitative Evaluation" by Eggertsson et al. (2019). The replication code instead (with the full OLG model above), is available at ECIN replication package for "Dynare replication of "A Model of Secular Stagnation: Theory and Quantitative Evaluation" by Eggertsson et al. (2019)".