PolicyEngine / PolicyEngine/microcosm

QRF amount forests lose donor design weights after the n-of-n bootstrap: extreme-tail draws are a seed lottery

Open
#481 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
0
Forks
4
Avg merge
1d 3h
Merged PRs (30d)
94

Description

Summary

The QRF's design-weight handling for amount forests is a single n-of-n weighted bootstrap of the positive donors, after which the forest fits unweighted and within-leaf quantiles are occurrence-weighted over bootstrap multiplicities (qrf.py:187-216, :493-513; the module header documents the design). For heavy-tailed sparse dollar targets this amplifies the extreme tail by construction:

  • a tiny-weight extreme donor's inclusion is a coin flip (the non_sch_d_capital_gains $594,483.64 row: 0.00755% of positive donor weight, expected bootstrap copies 0.47, present-at-least-once probability 37.5%);
  • once included it is floored at 1/n of the training array (2.13× its weight share for that row), and empirically drawn at 7.11× its weight share on Build M (4 of 7,452 positive draws);
  • the larger donors ($5.96M actual max, weight 1.1) were all omitted at seed 0 — so the shipped tail is a bootstrap lottery, not a bounded estimate, and a different seed could ship a far worse ceiling.

Deterministic replay evidence (seed-0 production target sequence reproduced the exact bootstrap composition and the $594,483.6449131259 ceiling) is in the #462 fix-3b diagnostic record.

Ask

Weight-aware within-leaf draws (or an equivalent estimator change that keeps original design weights available at draw time), so a donor's draw probability tracks its weight share instead of its bootstrap multiplicity. This is the root statistical fix behind #462's interim per-target tail bound and should come with cross-validation evidence on the affected stages.

Blast radius (from the diagnostic)

QRF is the public alias — every consumer redraws: ~25 US runtime constructors (puf_tax_detail chain, SCF, SIPP, ORG, housing, retirement, disability, voluntary filing, …) plus two UK SPI stages. Behavioral tests to adapt are enumerated in the diagnostic (weighted-fit contract, tail-share/interpolation, RNG determinism, chain bit-equality — behavioral constraints, not goldens).

Relates #462 (interim bound), #457 (same failure family in the frozen eCPS), #464 (tail-concentration gate = the backstop that detects this class).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in qrf.py:187-216 and 493-513, then read the #462 fix-3b diagnostic for the bootstrap composition and affected behavioral constraints. Trace the QRF public alias consumers and run the weighted-fit, tail-share/interpolation, RNG determinism, and chain bit-equality tests. Done means donor draw probabilities retain original design weights and cross-validation covers the affected stages without relying on seed-specific tail behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data, machine-learning
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.