Skip to content

Add distributional deviation model with app export - #8

Merged
MaxGhenis merged 1 commit into
mainfrom
v2b-distributional
Aug 7, 2026
Merged

MaxGhenis merged 1 commit into
mainfrom
v2b-distributional

Conversation

@MaxGhenis

Copy link
Copy Markdown
Contributor

Adds the v2b distributional deviation model on top of the corrected pipeline (#7): a full per-case predictive distribution of D = RAWBEN − BENFIX, exportable for in-browser Monte Carlo.

Components

  • Sign model P(D>0 | deviates), nested out-of-fold isotonic calibration (FY2024 AUC 0.700)
  • Conditional quantiles of log|D| at 9 levels, per-case monotone; Pareto tail beyond q99 (fitted scale 0.467, finite-mean condition holds)
  • Draw machinery (analysis/predictive_process.py), unit-tested against analytic expectations
  • Self-contained app export app/public/model_data.json (44,800 CASE==1 records, 53 jurisdictions; 783KB gzipped)

Validation (FY2024, weighted)

  • Quantile coverage within 3pp at 7 of 9 levels (q.75 −3.5pp, q.90 −3.3pp flagged)
  • Distributional vs direct stage-2 crossing rates: national 13.22% vs 12.92% (observed 13.39%); equal-state MAE 3.08 vs 3.02pp raw, 1.59 vs 1.56pp with FY2023-fit frozen factors
  • Model-vs-bootstrap simulated measured-rate table: the model's raw level underpredicts high-error states (NY −3.1pp) — documented in FINDINGS; app integration anchors levels on the model's own baseline point
  • Two byte-identical regenerations, independently reproduced (SHA256 match on all four artifacts); 46 tests; ruff clean

Simulator integration is intentionally not in this PR — app wiring follows separately.

🤖 Generated with Claude Code

@MaxGhenis
MaxGhenis merged commit 956c31a into main Aug 7, 2026
1 check passed
@MaxGhenis
MaxGhenis deleted the v2b-distributional branch August 7, 2026 04:00
MaxGhenis added a commit that referenced this pull request Aug 7, 2026
Draws each case's deviation from the fitted distributional model
(model_data.json, PR #8), mirroring predictive_process.py semantics:
piecewise-linear inverse CDF over [log tolerance, q05..q99] in log-dollar
space, exponential tail in logs beyond q99, error dollars strictly above
the year threshold. Baseline draws are cached per state and levels anchor
on the model's own baseline mean so the official rate is the baseline
center; the model's raw-level gap stays documented in FINDINGS.

Simplification levers require engine-computed counterfactual
intermediates and remain observed-mode only, stated in the UI.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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