Unfold complementarity conditions in heterogeneous models using Lagrange multipliers
The MR implements the transformation of complementarity conditions in heterogeneous-agent models using auxiliary Lagrange multipliers. When a heterogeneous variable is subject to lower and/or upper bound constraints, the preprocessor now unfolds these into an equivalent system consisting of a modified equation and a complementary slackness condition. Specifically, for each condition of the form lb ≤ x ≤ ub
, the transformation introduces auxiliary variables for the associated multipliers (MULT_L_x
, MULT_U_x
), rewrites the original equation by including the multiplier term, and adds the appropriate slackness equation (e.g., μ · (x − lb) = 0
).
This logic is handled in a new method HeterogeneousModel::transformPass()
, which is invoked during the preprocessing phase from ModFile::transformPass()
. The symbol table is extended to support heterogeneous auxiliary variables via the het_aux_vars
field, and a new method addHeterogeneousMultiplierAuxiliaryVar()
is provided to declare them. Relevant metadata (multiplier's positions in M_.heterogeneity(1).endo_names
, associated equation index) is stored and exported in the generated MATLAB structure under M_.heterogeneity(1).aux_vars
.
The new functionality is fully backward compatible: models without complementarity conditions are unaffected, and .mod
files require no additional syntax beyond existing complementarity
declarations. This lays the foundation for accurate numerical computation of multiplier policy functions at the steady state, based on residual evaluations, without burdening the user with manual implementation. It is also necessary to get the perturbed solutions right when the complementarity conditions bound constraints are binding.
Merge request reports
Activity
- Resolved by Normann Rion
mentioned in commit normann/dynare@c77e8598
mentioned in merge request dynare!2368 (merged)
- Resolved by Normann Rion
- Resolved by Normann Rion
- Resolved by Normann Rion
assigned to @sebastien
added 1 commit
- 662d08a4 - Unfold complementarity conditions in heterogeneous models using Lagrange multipliers
mentioned in commit normann/dynare@eaf4ec4e
added 1 commit
- dfd316b9 - Unfold complementarity conditions in heterogeneous models using Lagrange multipliers
enabled an automatic merge when all merge checks for dfd316b9 pass
mentioned in commit ebe33e3d
mentioned in commit normann/dynare@4ce5fcb9
mentioned in commit normann/dynare@c1d317c5