FA-12601 / Survey sampling estimators / Open access
Pooling a disproportionate stratified sample changes expansion totals · case 01
Pooling a disproportionate stratified sample changes expansion totals.
ROOT CAUSE
Observed values are pooled without preserving population stratum sizes.
VERIFIED REPAIR
Expand each stratum mean by its own known population count.
Unsuccessful approach: Using a common expansion factor still ignores disproportionate allocation.
Case contract
Strata are (known population count, nonempty sampled values); zero-population strata may have empty samples. Return None for an unsampled positive stratum; otherwise rounded total.
Why this case matters
A deterministic survey-design model isolates this sampling contract before it is embedded in a larger estimation pipeline.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(strata):
return sum(sum(v) for size,v in strata)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('disproportionate allocation',solve([(10,[N]),(2,[3*N,3*N])]),16*N)
check('single stratum expansion',solve([(8,[N,3*N])]),16*N)
check('census strata',solve([(1,[N]),(2,[2*N,4*N])]),7*N)
check('empty zero stratum',solve([(0,[]),(4,[N])]),4*N)
check('unobserved positive stratum',solve([(3,[])]),None)
check('empty frame',solve([]),0)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| disproportionate allocation | 7 | 16 | Failed |
| single stratum expansion | 4 | 16 | Failed |
| census strata | 7 | 7 | Passed |
| empty zero stratum | 1 | 4 | Failed |
| unobserved positive stratum | 0 | None | Failed |
| empty frame | 0 | 0 | Passed |
SHA-256 / caf3fc80ae89dd22513992acf50920672056c29da51cc024db5fa235d87218b7
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(strata):
values=[x for size,v in strata for x in v]
return round(sum(size for size,v in strata)*sum(values)/len(values),8) if values else 0
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('disproportionate allocation',solve([(10,[N]),(2,[3*N,3*N])]),16*N)
check('single stratum expansion',solve([(8,[N,3*N])]),16*N)
check('census strata',solve([(1,[N]),(2,[2*N,4*N])]),7*N)
check('empty zero stratum',solve([(0,[]),(4,[N])]),4*N)
check('unobserved positive stratum',solve([(3,[])]),None)
check('empty frame',solve([]),0)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| disproportionate allocation | 28.0 | 16 | Failed |
| single stratum expansion | 16.0 | 16 | Passed |
| census strata | 7.0 | 7 | Passed |
| empty zero stratum | 4.0 | 4 | Passed |
| unobserved positive stratum | 0 | None | Failed |
| empty frame | 0 | 0 | Passed |
SHA-256 / b6a25db79ab832c4d7d5e5febb0d483de9bcd3d95fd89caad40f62b619f70419
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(strata):
if any(size>0 and not v for size,v in strata): return None
return round(sum(size*sum(v)/len(v) for size,v in strata if size),8)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('disproportionate allocation',solve([(10,[N]),(2,[3*N,3*N])]),16*N)
check('single stratum expansion',solve([(8,[N,3*N])]),16*N)
check('census strata',solve([(1,[N]),(2,[2*N,4*N])]),7*N)
check('empty zero stratum',solve([(0,[]),(4,[N])]),4*N)
check('unobserved positive stratum',solve([(3,[])]),None)
check('empty frame',solve([]),0)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| disproportionate allocation | 16.0 | 16 | Passed |
| single stratum expansion | 16.0 | 16 | Passed |
| census strata | 7.0 | 7 | Passed |
| empty zero stratum | 4.0 | 4 | Passed |
| unobserved positive stratum | None | None | Passed |
| empty frame | 0 | 0 | Passed |
SHA-256 / b5c1085affb9f9eaa94fd1b73084855fa8c5a145f650fdf126d4dfd1b6b4ed17
Verification & scope
Controlled finite fixtures; not a general survey-analysis package. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:38:58.408963+00:00.
Case digest / 71b62470b64308c45fc2e38cbde6cef4e849f47a3759b0f2fed5fb81b2b3556a