Regional target algorithm refactoring - #2422
Draft
Renato-Rodrigues wants to merge 5 commits into
Draft
Conversation
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose of this PR
Replaces the carbon-price search behind regional emission targets (
47_regipol / regiCarbonPrice) with a least-squares slope (Newton) formulation plus an explicit convergence state machine.This PR fits the local price update response ΔEmissions/ΔPrice by least squares over a rolling window of the last 8 iterations in which the target actually steered its own price, and takes a Newton step bounded by a trust region.
Around that a state machine was built to deal with the noisy search characteristics of the issue:
Every tuning constant is overridable per scenario via the
cm_slopeParamswitch, without touching code.Nothing changes for runs without
cm_emiMktTarget.Docs:
tutorials/19_RegionalEmissionTargets.mdis new and covers usage, the algorithm, diagnostics and the test-scenario suite, with three generated decision graphs. Please check the tutorial for more details on how the algorithm works.https://github.com/Renato-Rodrigues/remind/blob/4163945d8ca9202b6aa6c643978f9d7ba1b55560/tutorials/19_RegionalEmissionTargets.md
What changed, by file
modules/47_regipol/regiCarbonPrice/postsolve.gms.../datainput.gms,declarations.gms,sets.gmsp47_targetState, per-iteration tracep47_slopeTrace_itermain.gmscm_slopeParamswitch;cm_emiMktTargetdocumentation (also fixes anESD→ESRtypo)modules/47_regipol/module.gmsconfig/scenario_config_emiMkt_tests.csvtutorials/19_RegionalEmissionTargets.md+figures/Test scenario suite
config/scenario_config_emiMkt_tests.csvcovers every target shape the syntax allows (multi-region, ETS/ESR split, nested group/member, multi-period, budget, net-zero, non-binding market, sub-noise-floor tolerance) plus A/B pairs: each mechanism has an off-arm, and an off-arm must never beat its base. Tutorial §4 documents each scenario and why it exists.Reporting updates
pik-piam/remind2#802
Results
Example results from a test run:
emiMkt_mult_2026-08-05_09.45.55with net-zero targets for CHA (2060), DEU (2030, 2045), EU (2030, 2050), UKI (2050), IND (2070), JPN (2050), USA (2050).Type of change
Indicate the items relevant for your PR by replacing ◻️ with ☑️.
Do not delete any lines. This makes it easier to understand which areas are affected by your changes and which are not.
Parts concerned
Impact
Checklist
Do not delete any line. Leave unfinished elements unchecked so others know how far along you are.
In the end all checkboxes must be ticked before you can merge.
make test) after my final commit and all tests pass (FAIL 0)remind2if and where it was neededforbiddenColumnNamesin readCheckScenarioConfig.R in case the PR leads to deprecated switchesCHANGELOG.mdcorrectly (added, changed, fixed, removed, input data/calibration)Further information (optional)
/p/projects/ecemf/REMIND/debug/remind_leastSquareSlope/output