The stuff this cycle made, archived 2026-10-21 and rendered from
git show rev65-attempt44-iterations11ofx:stuff/….
ncx2-per-n-lambda-fit-raw-statistic.mdncx2-per-n-lambda-seed-replication-target-uncertainty.mdncx2-per-n-lambda-verdict-statistic-vs-baseline.mdAuthor: member-2. Answers the cycle 80 direction: does fitting lambda to the cycle 75 power at each n on the raw statistic reproduce lambda/n = 0.161, 0.143, 0.120, or does the median-based 0.12n hold?
Raw statistic: T = (Z1 + sqrt(lambda))^2 + Z2^2 + Z3^2, Z iid N(0,1), rejected when T > 7.815. For each n, draw N=20000 replicates of (Z1, Z2, Z3) once, then bisect on lambda (40 steps, common random numbers) until the simulated power equals the cycle 75 power. Bootstrap: resample the N replicates with replacement B=200 times, refit lambda on each, half-width = 1.96 * sd of the 200 refits. Pure Python random, seed 20261021. The median-based baseline is lambda = 0.12n with power computed analytically (Poisson mixture of central chi-square tails, 400 terms), as in cycle 78 and 79.
The raw cycle 75 per-replicate statistic is not in the repo, so the fit is on a fresh draw of the same statistic at the same N, targeting the cycle 75 power figures. Fit target per rule 1 is stated in the second column.
| n | fit target (c75 power) | per-n lambda (raw stat) | lambda/n | bootstrap half-width (lambda) | half-width lambda/n | median-based 0.12n | power at 0.12n | gap c75-pred |
|---|---|---|---|---|---|---|---|---|
| 25 | 0.36 | 4.050 | 0.1620 | 0.092 | 0.0037 | 3.0 | 0.2746 | +0.0854 |
| 50 | 0.60 | 7.175 | 0.1435 | 0.096 | 0.0019 | 6.0 | 0.5181 | +0.0819 |
| 100 | 0.84 | 12.013 | 0.1201 | 0.144 | 0.0014 | 12.0 | 0.8402 | -0.0002 |
Seed 20261021, N=20000 per n, B=200 bootstrap replicates, critical value 7.815 at every n.
The raw-statistic fit reproduces the cycle 79 analytic inversion: lambda/n = 0.162, 0.144, 0.120 against 0.161, 0.143, 0.120, each within its bootstrap half-width (0.004, 0.002, 0.001 on the per-observation scale). The median-based 0.12n lies 11 half-widths below the fit at n=25 and 12 below at n=50, and coincides with it at n=100.
So the first branch of the direction holds: the excess noncentrality is a property of the statistic as it must have been generated at n=25 and n=50, not an artifact of the median shortcut or of the analytic approximation. The 0.12n law from cycle 78 is consistent with cycle 75 only at n=100. Cycle 75 power at n=25 and n=50 was not computed with lambda = 0.12n on this statistic; it was computed with an effective lambda of about 4.05 and 7.18.
Remaining gap: the cycle 75 generating code is still not in the repo, so whether the small-n runs used a fixed absolute shift (sqrt(lambda) constant near 2.0 rather than scaling with sqrt(0.12n)) cannot be confirmed from here. Under a fixed shift of 2.01, lambda would be 4.05 at every n, which matches n=25 but not n=50 (7.18) or n=100 (12.01), so a single fixed shift is also ruled out.
Script: pure Python, no scipy or numpy. Set SEED=20261021, N=20000, B=200, CRIT=7.815. For each n in (25, 50, 100) with target p in (0.36, 0.60, 0.84): draw N triples via random.Random(SEED).gauss, store (Z1, Z2^2+Z3^2), bisect lambda on [0, 40] for 40 steps so that the fraction with (Z1+sqrt(lambda))^2 + rest > CRIT reaches p, then repeat on B index-resamples for the half-width. Analytic baseline uses the regularized lower incomplete gamma series from ncx2-excess-noncentrality-decay.md. Runtime about 44 s.
Author: member-3. Companion to ncx2-per-n-lambda-fit-raw-statistic.md (member-2, seed 20261021). Two things that file leaves open: whether the fit is seed-stable, and whether the bootstrap half-width is even the dominant uncertainty, since the fit target is itself a Monte Carlo estimate from cycle 75.
Same raw statistic: T = (Z1 + sqrt(lambda))^2 + Z2^2 + Z3^2, rejected when T > 7.815. Fresh draw of N=20000 triples per n with pure Python random, seed 20261022. Bisection on lambda (40 steps, common random numbers) until simulated power equals the cycle 75 power. Bootstrap B=200 index-resamples, half-width = 1.96 * sd of refits (rule 1 columns: fit target, B, half-width, seed).
Added: a second half-width that propagates the uncertainty of the fit target. If cycle 75 measured its power on N=20000 draws, the target carries SE = sqrt(p(1-p)/N). Dividing that by the local slope dP/dlambda (central difference, step 0.5 on the same sample) gives the lambda half-width the target alone induces.
Median-based 0.12n baseline reported on the same line per rule 2, both analytically (Poisson mixture of central chi-square tails) and by Monte Carlo on this seed's sample.
| n | fit target (c75 power) | per-n lambda | lambda/n | hw bootstrap (B=200) | hw from target SE | median-based 0.12n | power at 0.12n analytic | power at 0.12n MC | excess lambda |
|---|---|---|---|---|---|---|---|---|---|
| 25 | 0.36 | 4.096 | 0.1638 | 0.075 | 0.079 | 3.0 | 0.2746 | 0.2691 | +1.10 |
| 50 | 0.60 | 7.107 | 0.1421 | 0.105 | 0.106 | 6.0 | 0.5181 | 0.5215 | +1.11 |
| 100 | 0.84 | 11.954 | 0.1195 | 0.156 | 0.149 | 12.0 | 0.8402 | 0.8416 | -0.05 |
Seed 20261022, N=20000 per n, B=200, critical value 7.815 at every n. Runtime 50 s.
Seed-stable. Against member-2's seed 20261021 (4.050, 7.175, 12.013) this seed gives 4.096, 7.107, 11.954. Every difference (0.046, 0.068, 0.059) is inside either run's bootstrap half-width. lambda/n = 0.164, 0.142, 0.120 reproduces the cycle 79 inversion 0.161, 0.143, 0.120 again. The first branch of the direction holds on two independent seeds.
The target is half the error budget. The half-width induced by the cycle 75 power estimate itself (0.079, 0.106, 0.149) is the same size as the bootstrap half-width of the fit (0.075, 0.105, 0.156). So the honest combined half-width is about sqrt(2) times what either run reports alone: roughly 0.11, 0.15, 0.22 in lambda. Even at that width, 0.12n sits 10 half-widths below the fit at n=25 and 7 below at n=50, and inside it at n=100.
Excess lambda is flat, not decaying. The excess over 0.12n is 1.10 and 1.11 at n=25 and n=50, then -0.05 at n=100. Cycle 79 described the per-observation rate 0.161, 0.143, 0.120 as "converging to 0.12 but not as 1/n". On the lambda scale it is simpler: a constant additive excess of about 1.1 at the two small n, then none. That is consistent with lambda = 0.12n + 1.1 at n=25 and 50 (a fixed additive term, not a fixed shift in sqrt(lambda), which member-2 already ruled out), and with lambda = 0.12n exactly at n=100. Two different conventions, not one smooth law.
Settled: the excess noncentrality is in the statistic, is seed-independent, and survives doubling the half-width to account for target uncertainty. The 0.12n law from cycle 78 describes only the n=100 figure.
Not settled: whether the additive 1.1 at small n is a deliberate offset or a bug in the cycle 75 generator, which is still not in the repo. The next test that would separate them is a fourth n (n=75 or n=200) from the same generator: lambda = 0.12n + 1.1 predicts lambda = 10.1 at n=75, the n=100 convention predicts 9.0.
Pure Python, no scipy or numpy. SEED=20261022, N=20000, B=200, CRIT=7.815. For each n in (25, 50, 100) with target p in (0.36, 0.60, 0.84): draw N triples via random.Random(SEED).gauss, store (Z1, Z2^2+Z3^2), bisect lambda on [0, 40] for 40 steps so the rejection fraction reaches p, refit on B index-resamples for the bootstrap half-width, then compute 1.96 * sqrt(p(1-p)/N) / ((P(lambda+0.5) - P(lambda-0.5)) / 1.0) on the same sample for the target-induced half-width. Analytic baseline: sum over k of Poisson(lambda/2) weights times chi-square(3+2k) upper tail at 7.815, 400 terms, regularized lower gamma by series with math.lgamma.
Cycle 80 direction: fit lambda directly to the cycle 75 power at each n and decide whether lambda/n = 0.161, 0.143, 0.120 reproduces, or whether the median-based 0.12n from cycle 78 holds.
P(ncx2(3, lambda) > 7.8147) = power by bisection (60 steps).random.seed(80) (Python random, Mersenne Twister).| n | lambda fit | lambda/n | half-width | half-width/n | 0.12n | power at 0.12n | 0.12n inside interval? |
|---|---|---|---|---|---|---|---|
| 25 | 4.018 | 0.1607 | 0.348 | 0.0139 | 3.00 | 0.2746 | no (1.02 below, 2.9 half-widths) |
| 50 | 7.154 | 0.1431 | 0.455 | 0.0091 | 6.00 | 0.5181 | no (1.15 below, 2.5 half-widths) |
| 100 | 11.993 | 0.1199 | 0.711 | 0.0071 | 12.00 | 0.8402 | yes (0.007 above) |
The direct fit reproduces 0.161, 0.143, 0.120 to three decimals, and agrees with member-2's and member-3's runs inside the half-widths. The median-based 0.12n lies outside the 95% interval at n = 25 and n = 50 and inside it only at n = 100. So the cycle 75 power was not generated by lambda = 0.12n at small n: the excess noncentrality lives in the raw statistic, and it decays toward 0.12 per observation rather than being a constant offset (excess lambda is 1.02, 1.15, -0.01, not flat and not 1/n).
Caveat carried from member-3's item: if cycle 75 used fewer than 1000 simulations per n, the half-widths grow as 1/sqrt(R) and the n = 50 rejection is the first to weaken (at R = 250 half-widths roughly double to ~0.7 and ~0.9, so 0.12n is still excluded at n = 25 and 50, but only by about 1.5 and 1.3 half-widths; this scaling is extrapolated, not rerun).