Skip to content

Geoadj oracle audit: formula validates exactly; rent table is the correctable gap - #33

Closed
MaxGhenis wants to merge 1 commit into
max/bls-2026-threshold-correctionfrom
max/geoadj-oracle-audit
Closed

MaxGhenis wants to merge 1 commit into
max/bls-2026-threshold-correctionfrom
max/geoadj-oracle-audit

Conversation

@MaxGhenis

Copy link
Copy Markdown
Contributor

Stacked on #32. The custom-geography adjustment path (states/counties/CDs) was the one subsystem with no ground-truth test — its tests pinned their own outputs. This audits the package's actual calculate_geoadj_from_rent against the Census SPM metro workbook's official per-metro, per-tenure adjustments (341 metros × 3 tenures), with the error decomposed:

Leg Result
Formula shape (package formula on the workbook's own rent index) reproduces official adjustments to ≤0.002% — Census's construction is literally rent_ratio × share + (1−share) with these shares
Rent source: overall median rent (B25064, current custom-path concept) 3.79% MAE vs the workbook index, max 18.5%
Rent source: two-bedroom rent (B25031_E004, the concept Census documents) 1.08% MAE, max 6.4% — 3× closer
End-to-end geoadj with two-bedroom rents 0.3–0.5% MAE by tenure; worst metro (Bend, OR) −3.0%

Full tables in docs/geoadj-audit.md; reproducible via scripts/audit_geoadj_oracle.py (keyless — uses the ACS table-based summary files on www2.census.gov, since api.census.gov now requires a registered key).

Follow-up filed separately: switch the custom-geography rent source to B25031 and regenerate the bundled sub-metro data.

🤖 Generated with Claude Code

The custom-geography path (states, counties, congressional districts)
had tests that pinned its own outputs — no ground truth. This audit
scores the package's actual formula against the Census SPM metro
workbook's official per-metro, per-tenure adjustments, with the error
decomposed into formula shape versus rent source:

- Formula shape validates essentially exactly: running
  calculate_geoadj_from_rent on the workbook's own rent index
  reproduces the official adjustments to within 0.002% across 341
  metros x 3 tenures. Census's construction is literally
  rent_ratio x share + (1 - share) with these housing shares.
- The rent source is the entire residual. Overall median gross rent
  (B25064, what the custom path uses) diverges from the workbook's
  rent index by 3.79% MAE (max 18.5%); two-bedroom gross rent
  (B25031_E004, the concept Census documents for SPM geographic
  adjustment) diverges by 1.08% MAE (max 6.4%) — three times closer.
  End-to-end geoadj error with two-bedroom rents: 0.3-0.5% MAE,
  worst metro under 3%.
- Rents come from the keyless ACS table-based summary files on
  www2.census.gov (the api.census.gov JSON endpoints now require a
  registered key).

Follow-up (separate change): switch the custom-geography rent source
to B25031 two-bedroom rents and regenerate the bundled sub-metro data.

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

vercel Bot commented Jul 18, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
spm-calculator Ready Ready Preview, Comment Jul 18, 2026 5:31pm

Request Review

@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Closing as superseded: this audit exercises spm_calculator.geoadj (scripts/audit_geoadj_oracle.py imports calculate_geoadj_from_rent from it). #36, merged 2026-09-11, replaced the legacy SPM calculations with the canonical rolling CE and ACS forecasts, and spm_calculator/geoadj.py no longer exists on main. Found in the 2026-09-28 open-PR sweep. Reopen if the audit should be ported to the new forecast path.

@MaxGhenis MaxGhenis closed this Sep 28, 2026

This branch was successfully deployed

1 active deployment
Preview — 08fd8148 Deployed Jul 18, 2026 by vercel[bot]
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