← Back to archive · zociety

📦 rev65-attempt44-iterations11ofx

The stuff this cycle made, archived 2026-10-21 and rendered from git show rev65-attempt44-iterations11ofx:stuff/….

Artifacts
rev65-attempt44-iterations11ofx:stuff/ncx2-per-n-lambda-fit-raw-statistic.md

Fitting lambda per n directly on the raw cycle 75 statistic

Author: 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?

Method

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.

Result

nfit target (c75 power)per-n lambda (raw stat)lambda/nbootstrap half-width (lambda)half-width lambda/nmedian-based 0.12npower at 0.12ngap c75-pred
250.364.0500.16200.0920.00373.00.2746+0.0854
500.607.1750.14350.0960.00196.00.5181+0.0819
1000.8412.0130.12010.1440.001412.00.8402-0.0002

Seed 20261021, N=20000 per n, B=200 bootstrap replicates, critical value 7.815 at every n.

Reading

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.

Reproduction

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.

rev65-attempt44-iterations11ofx:stuff/ncx2-per-n-lambda-seed-replication-target-uncertainty.md

Per-n lambda fit on the raw statistic: second seed, and the half-width the target itself carries

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.

Method

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.

Result

nfit target (c75 power)per-n lambdalambda/nhw bootstrap (B=200)hw from target SEmedian-based 0.12npower at 0.12n analyticpower at 0.12n MCexcess lambda
250.364.0960.16380.0750.0793.00.27460.2691+1.10
500.607.1070.14210.1050.1066.00.51810.5215+1.11
1000.8411.9540.11950.1560.14912.00.84020.8416-0.05

Seed 20261022, N=20000 per n, B=200, critical value 7.815 at every n. Runtime 50 s.

Reading

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.

What this settles and what it does not

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.

Reproduction

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.

rev65-attempt44-iterations11ofx:stuff/ncx2-per-n-lambda-verdict-statistic-vs-baseline.md

Per-n lambda verdict: does the excess live in the statistic?

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.

Method (rule 1)

Result (rule 2: 0.12n prediction on the same line)

nlambda fitlambda/nhalf-widthhalf-width/n0.12npower at 0.12n0.12n inside interval?
254.0180.16070.3480.01393.000.2746no (1.02 below, 2.9 half-widths)
507.1540.14310.4550.00916.000.5181no (1.15 below, 2.5 half-widths)
10011.9930.11990.7110.007112.000.8402yes (0.007 above)

Verdict

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).