Skip to content
Snippets Groups Projects

Unfold complementarity conditions in heterogeneous models using Lagrange multipliers

Merged Normann Rion requested to merge normann/preprocessor:ha_mcp into master
All threads resolved!

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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Normann Rion mentioned in merge request dynare!2368 (merged)

    mentioned in merge request dynare!2368 (merged)

  • Sébastien Villemot
  • Sébastien Villemot left review comments

    left review comments

  • Normann Rion added 1 commit

    added 1 commit

    • 662d08a4 - Unfold complementarity conditions in heterogeneous models using Lagrange multipliers

    Compare with previous version

  • Normann Rion resolved all threads

    resolved all threads

  • Normann Rion added 1 commit

    added 1 commit

    • dfd316b9 - Unfold complementarity conditions in heterogeneous models using Lagrange multipliers

    Compare with previous version

  • Normann Rion resolved all threads

    resolved all threads

  • Sébastien Villemot enabled an automatic merge when all merge checks for dfd316b9 pass

    enabled an automatic merge when all merge checks for dfd316b9 pass

  • mentioned in commit ebe33e3d

  • Please register or sign in to reply
    Loading