Skip to content

Connect every model page to the microsimulation scoring pipeline - #142

Merged
vahid-ahmadi merged 14 commits into
mainfrom
connect-models-to-microsim
Aug 4, 2026
Merged

Connect every model page to the microsimulation scoring pipeline#142
vahid-ahmadi merged 14 commits into
mainfrom
connect-models-to-microsim

Conversation

@vahid-ahmadi

@vahid-ahmadi vahid-ahmadi commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

What this PR does

This branch makes the PolicyEngine microsimulation the hub of the suite, in both directions, and adds DEFINE-UK as the seventh model.

Integration — macro→micro incidence bridges. A shared incidence-bridge pattern in integration/src/policyengine_macro/core.py and the extended assumptions.py: frbus_shock_incidence and hank_shock_incidence turn a macro shock's pre-tax wage/hours (FRB-US pl/lhp) or wage/labor (HANK w/N, now surfaced from the GE Jacobian) deviations into an employment-income overlay on the US microsim — automatic-stabilizer incidence, explicitly experimental and NOT reform scoring; score_reform continues to hard-refuse frbus/hank. svar_inflation_incidence prices the SVAR-vs-EFO CPI gap through a curated slice of CPI-uprated UK benefits (validated run: +0.94pp 2027 gap → £0.09bn 2028, largest relative gains in deciles 2–5). CLI + MCP surfaces added (20→23 tools), with frbus_payload/hank_payload escape hatches for splitting the macro solve and microsim across processes on memory-constrained machines. 563 lines of new incidence tests; suite: 245 passed / 70 skipped.

Website. Pipeline strip (reform → pe-microsim → obr-macro → score) on /score and /models; every model page now states its microsim connection (or exactly why none exists); homepage gains a Score-a-reform card; /define added as model 07 (experimental, pre-validation — upstream DEFINE-UK code is unlicensed, so PolicyEngine/define-uk-model fetches it at a pinned commit and runs it unmodified; no hosted surface, no quotable numbers until replication passes); counts updated six → seven with site_contract enforcement.

Forecasts. /forecasts model-vs-official now dynamically shows the latest archived SVAR round (was hardcoded to the superseded 2026-07-21 round), names the round displayed, explains the surge-sample mean-reversion behind the sticky CPI path, and states the error-sign convention. Scoring/archive/ingest checks pass; nothing under forecasts/rounds/ touched.

Review process. Three rounds of independent review agents (code + website + final verification): all findings fixed in-branch; final verdict merge-ready. The only failing tests (6 in test_site_contract.py, missing papers/index.html) pre-exist on main.

🤖 Generated with Claude Code

- Pipeline strip (reform → pe-microsim → obr-macro → score) on /score and /models
- /pe declares itself the hub and links to /score
- /olg body now describes the two-way micro coupling incl. og+microsim
- /svar, /frb-us, /us-hank callouts route to /pe and /score with the
  reason no bridge exists
- Homepage gains a Score-a-reform strategy card; /connect gains the
  score CLI command and a /score link; /economy ties the baseline to
  scoring and the forecast record

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
macromod Ready Ready Preview Aug 4, 2026 1:31pm

Request Review

vahid-ahmadi and others added 2 commits August 1, 2026 00:01
- score.py picks the newest boe-svar round instead of hardcoding 2026-07-21;
  §03 names the displayed round and explains the surge-sample mean reversion
  behind the sticky CPI path; §02 states the error-sign convention
- us-hank: 'It cannot' callout becomes a bullet list
- connect: centered client tabs, full-width hero lede, compact Python picker
- forecasts charts widen to 1080px

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Integration:
- EconomicAssumptions.from_frbus_result / from_hank_result: annual-mean
  wage(+hours/labor) deviations become a pre-tax earnings factor with the
  OG overlay's double-counting invariant and plausibility gates
- frbus_shock_incidence, hank_shock_incidence, svar_inflation_incidence:
  reform-free automatic-stabilizer incidence via _pe_population_incidence;
  score_reform refusals unchanged, now pointing at the incidence tools
- hank_shock surfaces the pre-tax real wage w and labor N IRFs
- svar_inflation_incidence prices the SVAR-vs-EFO CPI gap through a
  curated slice of CPI-uprated benefits (validated run: +0.94pp gap ->
  GBP 0.09bn in 2028, gains in deciles 2-5)
- frbus_payload/hank_payload two-process escape hatches (8GB hosts
  jetsam-kill the combined solve+microsim process); CLI flags to match
- 30 unit tests; full suite 245 passed

Website:
- DEFINE-UK added as model 07 (experimental, pre-validation; unlicensed
  upstream run unmodified at a pinned commit via PolicyEngine/define-uk-model)
- /svar, /frb-us, /us-hank gain incidence examples; /pe and /score
  describe the macro-to-micro return direction; counts six -> seven

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ero steady state raises instead of omitting; stale connect comment

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…; experimental label)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
/score was only reachable through in-page links; it is now a top-level
nav destination (and breadcrumb section) generated by site_nav.py.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…odel pages

Per review: no separate score page. The /models scoring section (now
anchored #score, open by default) absorbs the run-it command and the
uncertainty caveat; the worked mechanics were already on /pe and /obr.
All internal links repoint to /models#score, /score 301-redirects there,
nav item removed, sitemap updated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
/papers and /validation index pages were retired when /models became the
hub (main); the disclosures the tests guard moved to obr/code,
obr/validation, svar/validation, and the paper landings. Same guarantees,
new locations.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Score-a-reform is the first strategy card and the chooser band comes
before the outturns table, matching the site's center of gravity:
PolicyEngine microsimulation and policy/economic analysis first,
economy monitoring second.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… and model page

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…parisons

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
vahid-ahmadi and others added 2 commits August 4, 2026 15:30
…ility note beside the machine-precision claim

The April 2026 LONGBASE misses realized 2026Q1 core PCE by -1.7pp while
tracking GDP, unemployment, and the funds rate within ~0.3pp — now stated
next to the replication-fidelity metrics, sourced to the model repo's
weekly outturn backtest.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vahid-ahmadi
vahid-ahmadi merged commit eadecf5 into main Aug 4, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant