FAILURE MAP
← Case archive

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.

Verified by executionVariant 1 · 6 checks per implementationDownload source bundle ↓JSON ↗

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 fixtureActualExpectedOutcome
disproportionate allocation716Failed
single stratum expansion416Failed
census strata77Passed
empty zero stratum14Failed
unobserved positive stratum0NoneFailed
empty frame00Passed

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 fixtureActualExpectedOutcome
disproportionate allocation28.016Failed
single stratum expansion16.016Passed
census strata7.07Passed
empty zero stratum4.04Passed
unobserved positive stratum0NoneFailed
empty frame00Passed

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 fixtureActualExpectedOutcome
disproportionate allocation16.016Passed
single stratum expansion16.016Passed
census strata7.07Passed
empty zero stratum4.04Passed
unobserved positive stratumNoneNonePassed
empty frame00Passed

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