Milestone 2: solved baseline GDP path vs the oracle, and the 17 power-sector divergences

オープン
#17 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
20/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
data, testing-qa

調査の方向性

Start with tests/test_oracle.py, DIVERGENT, and VALIDATION.md to diagnose the 17 power-sector equation differences and settle the Eq. (23) gap. Then implement the listed sector modules under src/define_uk/model/sectors/ and run the per-equation oracle comparison. Finish by removing the xfail and §3.3.3 guard, recording a tolerance in reference_outputs.json and VALIDATION.md, and passing the solved GDP path comparison.

索引モデルが issue の本文から書いたものです。

説明

enhancement

Follow-on to #1, whose three items are met (see the closing comment there). Before DEFINE-UK results go beyond replication of the pinned upstream run, the remaining gap is reimplementation milestone 2: our clean-room model has to reproduce the oracle's baseline GDP path from a solve, not only equation by equation.

Where it stands (6 Nov 2026, PR #15)

  • Per-equation oracle comparison (tests/test_oracle.py::test_registered_equations_reproduce_the_oracle). Each of the 118 registered equations (§3.2–§3.3.2) is evaluated on the oracle's own inputs, 2023Q1–2040Q4, in five cached files. Results:
    • 68 reproduce within 2e-3 relative (4-significant-figure printing) in all five files.
    • Eq. (23) GCF reproduces in four. In GPI + Green Bonds it differs by exactly SPEND_GVTPS: the oracle counts on-balance-sheet green power investment in GCF, and the printed equation does not.
    • 17 diverge, pinned in DIVERGENT: GOS_PS, MC_FF, P_ELEC, YD_PS, DIVR_PS, RP_PS, GCF_PSFFD, GCF_PSNFFD, GCF_PSNFF, GCF_PS, GCF_PSNFFR, prop_NFF, EQLTR_PS, RESTR_PS, DEF_PS, NW_PS, CR_PS. All of them are §3.3.2 (power sector).
    • 32 cannot be compared one at a time, because an input or output is not a CSV column: lam, mu, WS, the OT* residual instruments, delta_KPS, and others.
  • Solved GDP-path comparison: not written. test_baseline_gdp_path_matches_oracle is a strict xfail.
  • Sector modules: §3.3.3 and §3.4.1–§3.4.7 are 12-line stubs (src/define_uk/model/sectors/{nfc,mfi,nmfi,government,households,row,returns,ecosystem}.py).

Work, in order

  1. Diagnose the 17 §3.3.2 divergences against the manual: transcription error, manual gap, or a scenario-switch term that the manual does not print, like Eq. (23). P_ELEC (Eq. (84)) already has a candidate explanation (VALIDATION.md 2026-08-12: t_ELECswitch/P_ELECLR). Move each one to REPRODUCED or record it as a manual gap.
  2. Settle Eq. (23): record it as a manual gap ("GCF includes SPEND_GVTPS when GVT_INVEST = 1") or ask upstream. This matters for the GPI multiplier (#16).
  3. §3.3.3, then §3.4.1–§3.4.7. Each sector lands with the per-equation oracle comparison passing, or with pinned divergences.
  4. The milestone-2 gate: solve §3.2–§3.3 for the S1 baseline from the §5 initial values, feeding the oracle's paths for the variables still exogenous to our registry. Compare GDP_R and GDP over 2023–2040. Record the tolerance in reference_outputs.json and VALIDATION.md. Remove the xfail and the §3.3.3 guard in the same PR.

Dependencies and constraints

  • The upstream is unlicensed (LICENSE-STATUS.md), so the oracle tests can only run where a cached run exists, never in CI. The hermetic test_every_equation_is_classified does run in CI.
  • Upstream answers are pending on DEFINE_UK_1.1 #1 and #2 (VALIDATION.md "Upstream queries").
  • The review machine has R 4.3 but is missing 16 of the notebook's R packages (define_uk.runner.check_r()). So no new oracle runs can be made there, including policy-size variants for a scenario sweep. Installing them is Vahid's call.

Acceptance

  • test_baseline_gdp_path_matches_oracle passes without the xfail, at a recorded tolerance.
  • DIVERGENT is empty, or every remaining entry is documented as a manual gap.

🤖 Generated with Claude Code

主要言語
Python
スター
0
フォーク
0
平均マージ
4日 14時間
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PolicyEngine/define-uk-model のほかの issue

PolicyEngine/define-uk-model の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。