Review index · Download editable notebook
Executed top-to-bottom in a fresh kernel.
Cell 0 · statistics-00
03 — Poisson detection, pulse morphology and red upper limits
This is an executable, lightweight review of the statistical experiment. It uses synthetic receiver-input counts, not measured source-depth labels. It does not rerun the original 81,000-pulse generator.
Full derivations, equation IDs S01–S21, units, source functions and selection limits are in methods/statistics.md. The original scripts are retained for comparison; this notebook calls a new implementation.
Required: NumPy and SciPy in the portable runtime. Optional Node checks are labelled NOT_RUN when Node is unavailable. No downloads, installs or large simulations occur here.
Cell 1 · statistics-01 · execution 1
from pathlib import Path
import sys, json, shutil, time
start = Path.cwd().resolve()
ROOT = next((p for p in [start, *start.parents] if (p / "modules/common.py").is_file()), None)
if ROOT is None:
raise RuntimeError("Open this notebook from within the verification package.")
for p in [ROOT / "runtime/deps", ROOT / "modules"]:
if p.is_dir():
sys.path.insert(0, str(p))
from common import table, H, C, PHOTON_ENERGY_337, PHOTON_ENERGY_777
import statistics_review as st
import numpy as np
import scipy
print("Package:", ROOT)
print("NumPy:", np.__version__, "SciPy:", scipy.__version__)
print("Source:", Path(st.__file__).relative_to(ROOT))
Package: D:\Photometer_research_20261022\verification_20261022_r1
NumPy: 2.3.5 SciPy: 1.18.1
Source: modules\statistics_review.py
Cell 2 · statistics-02
Execute the bounded checks
This call checks count tails and intervals, generates one explicit-bin pulse, independently fits its likelihood, and rebuilds decisions and intervals from the 81 saved synthetic trial summaries. It also checks source-free and background-free profile boundaries.
A software check does not establish physical source depth, hardware sensitivity or useful orbital event rate.
Cell 3 · statistics-03 · execution 2
tick = time.perf_counter()
audit = st.run_checks(write=True)
elapsed_s = time.perf_counter() - tick
assert audit["passed"]
print("Checks completed in", round(elapsed_s, 3), "s")
print("Output: checks/statistics_results.json")
print("Saved scenarios:", audit["confusions"]["scenarios"])
print("Recomputed metrics:", audit["confusions"]["metrics_recomputed"])
print("Optional JavaScript status:", audit["javascript"]["status"])
Checks completed in 3.927 s
Output: checks/statistics_results.json
Saved scenarios: 81
Recomputed metrics: 648
Optional JavaScript status: EXECUTED_OPTIONAL_NODE
Cell 4 · statistics-04
Photon reference planes — S01–S02
For an assumed efficiency and entrance area , expected primary counts are . The aperture fluence already includes atmospheric delivery. Multiplication gain is not another photon efficiency.
The following is an assumed conversion, not a threshold or emitted-source yield.
Cell 5 · statistics-05 · execution 3
table([audit["photon_planes"]], max_rows=1)
| expected_source_primary_PE | assumed_efficiency | area_m2 | expected_aperture_photons | aperture_photon_fluence_m2 | aperture_energy_fluence_J_m2_at337 | E337_J | E777_J | qualification |
|---|
| 100 | 0.2 | 1.9634954e-05 | 500 | 25464791 | 1.5005763e-11 | 5.8927495e-19 | 2.5552429e-19 | Aperture photons after propagation; no emitted-source yield or second cloud attenuation; no PMT/APD gain factor. |
1 rows total; 1 shown.
Cell 6 · statistics-06
Detection with known background — S05–S06
The critical integer is the smallest such that . Required signal is an expected source count solving .
The two alphas are a single-gate tail and a hypothetical fixed search allocation. Neither validates an adaptive spacecraft trigger or a physical false-event rate.
Cell 7 · statistics-07 · execution 4
table(audit["counts"]["threshold_power_checks"], max_rows=20)
print("Zero-background critical count:", st.critical_known(0))
print("Zero-background source mean for 95% detection:", st.required_signal_known(0)["source_mean_PE"])
| background_PE | alpha_per_test | critical | source_mean_PE | background_mean_PE | power | tail | critical_direct_sum | power_direct_sum |
|---|
| 0 | 2.8665157e-07 | 1 | 2.9957323 | 0 | 0.95 | 0 | 1 | 0.95 |
| 0 | 7.7160494e-12 | 1 | 2.9957323 | 0 | 0.95 | 0 | 1 | 0.95 |
| 0.01 | 2.8665157e-07 | 3 | 6.2857936 | 0.01 | 0.95 | 1.6542165e-07 | 3 | 0.95 |
| 0.01 | 7.7160494e-12 | 5 | 9.143519 | 0.01 | 0.95 | 8.2641856e-13 | 5 | 0.95 |
| 1 | 2.8665157e-07 | 10 | 14.705216 | 1 | 0.95 | 1.1142548e-07 | 10 | 0.95 |
| 1 | 7.7160494e-12 | 14 | 19.668569 | 1 | 0.95 | 4.5198525e-12 | 14 | 0.95 |
| 10 | 2.8665157e-07 | 30 | 29.540972 | 10 | 0.95 | 2.5099512e-07 | 30 | 0.95 |
| 10 | 7.7160494e-12 | 39 | 39.808464 | 10 | 0.95 | 2.9598815e-12 | 39 | 0.95 |
| 100 | 2.8665157e-07 | 155 | 76.030825 | 100 | 0.95 | 2.1239031e-07 | 155 | 0.95 |
| 100 | 7.7160494e-12 | 175 | 97.31288 | 100 | 0.95 | 7.5905324e-12 | 175 | 0.95 |
| 1000 | 2.8665157e-07 | 1163 | 219.65683 | 1000 | 0.95 | 2.6749344e-07 | 1163 | 0.95 |
| 1000 | 7.7160494e-12 | 1222 | 280.06222 | 1000 | 0.95 | 6.3394806e-12 | 1222 | 0.95 |
| 100000 | 2.8665157e-07 | 101586 | 2110.8248 | 100000 | 0.95 | 2.8493978e-07 | 101586 | 0.95 |
| 100000 | 7.7160494e-12 | 102141 | 2667.255 | 100000 | 0.95 | 7.6279109e-12 | 102141 | 0.95 |
| 1000000 | 2.8665157e-07 | 1005005 | 6654.5331 | 1000000 | 0.95 | 2.859063e-07 | 1005005 | 0.95 |
| 1000000 | 7.7160494e-12 | 1006752 | 8402.9656 | 1000000 | 0.95 | 7.6994181e-12 | 1006752 | 0.95 |
16 rows total; 16 shown.
Zero-background critical count: 1
Zero-background source mean for 95% detection: 2.995732273553991
Cell 8 · statistics-08
Downstream threshold bindings
All 216 FOV and 192 auroral rows are checked against their declared known-background mean and false-alarm allocation. The FOV variable named alpha is a population slope, not the false-alarm alpha. The latter is recovered from the retained source constants without executing that source.
This verifies only the statistical columns. It does not validate a brightness population, sky scene, field geometry or useful mission rate.
Cell 9 · statistics-09 · execution 5
bindings = audit["downstream_threshold_bindings"]
print(bindings["status"])
print("Rows:", bindings["rows_checked"], "Unique (background, alpha) computations:",
bindings["unique_background_alpha_computations"])
print("Largest S95 difference (PE):", bindings["maximum_S95_absolute_difference_PE"])
print("Largest power difference:", bindings["maximum_power_absolute_difference"])
show = [r for r in bindings["rows"] if r["study"] == "fov_population"][:2]
show += [r for r in bindings["rows"] if r["study"] == "auroral_counts"][:2]
table(show, max_rows=4)
ALL408_STATISTICAL_COLUMN_BINDINGS_CHECKED
Rows: 408 Unique (background, alpha) computations: 228
Largest S95 difference (PE): 1.2287055142223835e-06
Largest power difference: 1.2996648202090455e-10
| study | row_index | background_mean_PE | alpha_per_test | alpha_source | stored_critical | recomputed_critical | stored_S95_PE | recomputed_S95_PE | S95_abs_difference_PE | power_at_stored_S95 |
|---|
| fov_population | 0 | 0.2797699 | 7.7160494e-12 | reference/analytic/fov_population.py:41 -> count_requirements.py ALPHA_OPERATIONAL | 10 | 10 | 15.425447 | 15.425447 | 5.3290705e-15 | 0.95 |
| fov_population | 1 | 0.2797699 | 7.7160494e-12 | reference/analytic/fov_population.py:41 -> count_requirements.py ALPHA_OPERATIONAL | 10 | 10 | 15.425447 | 15.425447 | 5.3290705e-15 | 0.95 |
| auroral_counts | 0 | 0.045678647 | 2.8665157e-07 | row.per_test_alpha | 4 | 4 | 7.7079779 | 7.7079779 | 3.5527137e-15 | 0.95 |
| auroral_counts | 1 | 0.045678647 | 7.7160494e-12 | row.per_test_alpha | 7 | 7 | 11.796717 | 11.796717 | 5.3290705e-15 | 0.95 |
4 rows total; 4 shown.
Cell 10 · statistics-10
Finite baseline and red limits — S03–S12
For , , , condition on N+M under the null:
Inspect original LaTeX
N\mid N+M \sim \operatorname{Binom}(N+M,1/(1+r)).
Known-background upper limits subtract a known fixed . Finite-baseline limits use a conservative union-bound construction with a prechosen alpha split. Plugging into a known-background limit is a different procedure.
Selecting only nondetections using the same counts can alter conditional coverage.
Cell 11 · statistics-11 · execution 6
table(audit["counts"]["onoff_checks"], max_rows=10)
table(audit["counts"]["upper_inversions"], max_rows=10)
print(json.dumps(audit["counts"]["zero_count_controls"], indent=2))
table(audit["counts"]["coverage_finite_enumerations"], max_rows=10)
| n_on | m_off | r_off_over_on | SciPy | finite_sum |
|---|
| 0 | 0 | 10 | 1 | 1 |
| 1 | 0 | 10 | 0.090909091 | 0.090909091 |
| 10 | 0 | 10 | 3.8554329e-11 | 3.8554329e-11 |
| 5 | 2 | 3 | 0.012878418 | 0.012878418 |
| 30 | 40 | 10 | 8.0370233e-14 | 8.0370233e-14 |
| 100 | 200 | 10 | 1.9795037e-31 | 1.9795037e-31 |
6 rows total; 6 shown.
| n_on | known_b_PE | source95_upper_PE | total_mean_inversion_CDF |
|---|
| 0 | 0 | 2.9957323 | 0.05 |
| 0 | 2 | 0.99573227 | 0.05 |
| 1 | 0 | 4.7438645 | 0.05 |
| 3 | 2 | 5.7536565 | 0.05 |
| 10 | 5 | 11.962219 | 0.05 |
| 100 | 80 | 38.079273 | 0.05 |
6 rows total; 6 shown.
{
"known_zero_background95": 2.9957322735539913,
"finite_baseline_zero_zero95": 3.6888794541139363
}
| source_PE | b_on_PE | r | known_b_enumerated_coverage | finite_off_enumerated_coverage | omitted_probability_bound |
|---|
| 0 | 0 | 10 | 1 | 1 | 0 |
| 1 | 0 | 10 | 1 | 1 | 0 |
| 3 | 2 | 10 | 0.95957232 | 0.99351067 | 4.2188475e-15 |
| 10 | 3 | 5 | 0.97411308 | 0.99222898 | 7.7715612e-16 |
4 rows total; 4 shown.
Cell 12 · statistics-12
Worked likelihood with every bin exposed — S13–S16
The unit-peak ramp has an 80 µs 10–90% rise and ends 3 ms after onset. Early bins, one late plateau and an independent 10 ms prewindow form this example.
For each bin, . Both and are in seconds; are primary count rates; are counts.
With , , , , the total-scale MLE is . A concave profile gives , .
A separate two-rate optimizer checks the original likelihood. It does not call the old R4 fitter. The table includes all bins in early/late/prewindow order, not chronological order.
Cell 13 · statistics-13 · execution 7
example = audit["worked_example"]
print("Seed:", example["seed"], "Observed total:", example["observed_total_PE"])
table([
{"method": "concave mixture profile", **example["profile"]},
{"method": "direct two-rate SciPy optimization", **example["direct_SciPy_two_parameter_fit"]},
], max_rows=2)
print("Absolute log-likelihood difference:", example["absolute_loglikelihood_difference"])
print("Fitted total minus observed counts:", example["fitted_total_minus_observed_PE"])
table(example["bins"], max_rows=40)
Seed: 202610221110 Observed total: 743
| method | theta | A_cps | b_cps | logL |
|---|
| concave mixture profile | 0.83793731 | 343023.37 | 10034.381 | -51.507368 |
| direct two-rate SciPy optimization | | 343023.37 | 10034.381 | -51.507368 |
2 rows total; 2 shown.
Absolute log-likelihood difference: 2.1316282072803006e-14
Fitted total minus observed counts: 0.0
| bin | label | left_s | right_s | d_s | q_s | n_PE | truth_mean_PE | fitted_mean_PE |
|---|
| 0 | early | -0.0001 | -8e-05 | 2e-05 | 0 | 0 | 0.2 | 0.20068763 |
| 1 | early | -8e-05 | -6e-05 | 2e-05 | 0 | 1 | 0.2 | 0.20068763 |
| 2 | early | -6e-05 | -4e-05 | 2e-05 | 0 | 0 | 0.2 | 0.20068763 |
| 3 | early | -4e-05 | -2e-05 | 2e-05 | 0 | 0 | 0.2 | 0.20068763 |
| 4 | early | -2e-05 | 0 | 2e-05 | 0 | 0 | 0.2 | 0.20068763 |
| 5 | early | 0 | 2e-05 | 2e-05 | 0 | 1 | 0.2 | 0.20068763 |
| 6 | early | 2e-05 | 4e-05 | 2e-05 | 1.25e-07 | 0 | 0.24166667 | 0.24356555 |
| 7 | early | 4e-05 | 6e-05 | 2e-05 | 3e-06 | 0 | 1.2 | 1.2297577 |
| 8 | early | 6e-05 | 8e-05 | 2e-05 | 7e-06 | 2 | 2.5333333 | 2.6018512 |
| 9 | early | 8e-05 | 0.0001 | 2e-05 | 1.1e-05 | 2 | 3.8666667 | 3.9739447 |
| 10 | early | 0.0001 | 0.00012 | 2e-05 | 1.5e-05 | 4 | 5.2 | 5.3460382 |
| 11 | early | 0.00012 | 0.00014 | 2e-05 | 1.8875e-05 | 10 | 6.4916667 | 6.6752538 |
| 12 | early | 0.00014 | 0.00016 | 2e-05 | 2e-05 | 7 | 6.8666667 | 7.0611551 |
| 13 | early | 0.00016 | 0.00018 | 2e-05 | 2e-05 | 4 | 6.8666667 | 7.0611551 |
| 14 | early | 0.00018 | 0.0002 | 2e-05 | 2e-05 | 10 | 6.8666667 | 7.0611551 |
| 15 | early | 0.0002 | 0.00022 | 2e-05 | 2e-05 | 5 | 6.8666667 | 7.0611551 |
| 16 | early | 0.00022 | 0.00024 | 2e-05 | 2e-05 | 3 | 6.8666667 | 7.0611551 |
| 17 | early | 0.00024 | 0.00026 | 2e-05 | 2e-05 | 9 | 6.8666667 | 7.0611551 |
| 18 | early | 0.00026 | 0.00028 | 2e-05 | 2e-05 | 5 | 6.8666667 | 7.0611551 |
| 19 | early | 0.00028 | 0.0003 | 2e-05 | 2e-05 | 8 | 6.8666667 | 7.0611551 |
| 20 | early | 0.0003 | 0.00032 | 2e-05 | 2e-05 | 10 | 6.8666667 | 7.0611551 |
| 21 | early | 0.00032 | 0.00034 | 2e-05 | 2e-05 | 7 | 6.8666667 | 7.0611551 |
| 22 | early | 0.00034 | 0.00036 | 2e-05 | 2e-05 | 7 | 6.8666667 | 7.0611551 |
| 23 | early | 0.00036 | 0.00038 | 2e-05 | 2e-05 | 12 | 6.8666667 | 7.0611551 |
| 24 | early | 0.00038 | 0.0004 | 2e-05 | 2e-05 | 8 | 6.8666667 | 7.0611551 |
| 25 | late_plateau | 0.001 | 0.0025 | 0.0015 | 0.0015 | 528 | 515 | 529.58663 |
| 26 | prewindow | -0.0105 | -0.0005 | 0.01 | 0 | 100 | 100 | 100.34381 |
27 rows total; 27 shown.
Cell 14 · statistics-14
The next table searches three rise templates and an onset grid with unknown amplitude/background. Its winning template is a waveform morphology, not cloud depth. An individual noisy outcome may differ from its generating label.
Cell 15 · statistics-15 · execution 8
table(example["top_grid_candidates"], max_rows=9)
| rise_us | onset_us | A_cps | b_cps | logL |
|---|
| 80 | 50 | 345828.07 | 10042.456 | -50.573975 |
| 80 | 45 | 344901.86 | 10037.678 | -50.664439 |
| 80 | 55 | 346734.8 | 10050.919 | -50.757771 |
| 80 | 40 | 343965.56 | 10035.194 | -50.978595 |
| 80 | 60 | 347599.54 | 10066.402 | -51.306984 |
| 30 | 65 | 342710.2 | 10046.05 | -51.408867 |
| 30 | 70 | 343482.88 | 10072.219 | -51.500882 |
| 80 | 35 | 343023.37 | 10034.381 | -51.507368 |
| 30 | 60 | 341831.63 | 10036.596 | -51.761316 |
9 rows total; 9 shown.
Cell 16 · statistics-16
Rebuild denominators and Monte Carlo intervals — S17–S19
A fixed profile-score gap is a rejection heuristic, not calibrated 95% confidence. Detection/all trials, acceptance/all trials and wrong/accepted trials have different denominators.
The summaries contain fitted scores and gate/prewindow counts, not every original bin count. Reconstructing them verifies decisions, tables and intervals; it does not independently refit 81,000 pulses.
The table shows the 50 kS/s low-background subset. Full results remain in the machine-readable output. Error is undefined when no trial is accepted.
Cell 17 · statistics-17 · execution 9
rebuilt = audit["confusions"]
print("Scenarios:", rebuilt["scenarios"], "Synthetic pulses:", rebuilt["signal_trials"])
print("Metrics:", rebuilt["metrics_recomputed"])
print("Largest interval difference from retained report:", rebuilt["max_interval_absolute_difference"])
rows = []
for x in rebuilt["rows"]:
if x["sample_khz"] == 50 and x["background_cps"] == 50:
detected, a3, w3, a2, w2, r3, r2, allerr = x["rebuilt_metrics"]
rows.append({
"plateau_equivalent_PE": x["N_plateau_equivalent_PE"],
"true_receiver_rise_us": x["truth_rise_us"],
"detected_n": detected["k"],
"accepted_n": a2["k"],
"wrong_n": w2["k"],
"wrong_denominator": w2["n"],
"wrong_fraction": w2["fraction"],
"individual_exact95_interval": w2["Clopper_Pearson"],
"confusion_fast_slow_reject_undetected": x["confusion_fastslow"],
})
table(rows, max_rows=12)
Scenarios: 81 Synthetic pulses: 81000
Metrics: 648
Largest interval difference from retained report: 2.220446049250313e-16
| plateau_equivalent_PE | true_receiver_rise_us | detected_n | accepted_n | wrong_n | wrong_denominator | wrong_fraction | individual_exact95_interval | confusion_fast_slow_reject_undetected |
|---|
| 100 | 30 | 1000 | 21 | 0 | 21 | 0 | [0.0, 0.16109761521907962] | [21, 0, 979, 0] |
| 100 | 80 | 1000 | 2 | 0 | 2 | 0 | [0.0, 0.841886116991581] | [2, 0, 998, 0] |
| 100 | 200 | 1000 | 0 | 0 | 0 | None | [null, null] | [0, 0, 1000, 0] |
| 1000 | 30 | 1000 | 956 | 0 | 956 | 0 | [0.0, 0.0038512254525673623] | [956, 0, 44, 0] |
| 1000 | 80 | 1000 | 693 | 4 | 693 | 0.0057720058 | [0.0015748498838513603, 0.014712188300512097] | [689, 4, 307, 0] |
| 1000 | 200 | 1000 | 580 | 15 | 580 | 0.025862069 | [0.014545446707021925, 0.04229721667197348] | [15, 565, 420, 0] |
| 10000 | 30 | 1000 | 1000 | 0 | 1000 | 0 | [0.0, 0.003682083896865672] | [1000, 0, 0, 0] |
| 10000 | 80 | 1000 | 1000 | 0 | 1000 | 0 | [0.0, 0.003682083896865672] | [1000, 0, 0, 0] |
| 10000 | 200 | 1000 | 1000 | 0 | 1000 | 0 | [0.0, 0.003682083896865672] | [0, 1000, 0, 0] |
9 rows total; 9 shown.
Cell 18 · statistics-18
Independent numerical precision checks
Selected tails are summed from Poisson masses; selected on/off tails are finite binomial sums. No Gaussian approximation replaces the count probabilities.
The high-mean pins come from a retained 60-digit Decimal/Stirling/geometric-remainder calculation. They expose a small SciPy incomplete-gamma precision limitation near a mean of . The tested critical integers agree. This is bounded floating-point QA, not formal directed interval arithmetic.
Cell 19 · statistics-19 · execution 10
table(audit["counts"]["pinned_high_mean_controls"], max_rows=4)
table(audit["counts"]["tail_checks"], max_rows=12)
| mean | n_inclusive | pinned_60digit_Decimal_tail | direct_recurrence | relative_difference | SciPy_tail | provenance |
|---|
| 1000000 | 1005000 | 2.934034e-07 | 2.934034e-07 | 1.7763568e-13 | 2.9340205e-07 | R4 qa/browser_large_mean_tail_control.json;60digit Decimal/Stirling/geometric-remainder calculation, not empirical data. |
| 1000000 | 1007000 | 1.3595738e-12 | 1.3595738e-12 | 1.2878587e-13 | 1.3595736e-12 | R4 qa/browser_large_mean_tail_control.json;60digit Decimal/Stirling/geometric-remainder calculation, not empirical data. |
| 1000000 | 1005004 | 2.8739184e-07 | 2.8739184e-07 | 5.0759397e-13 | 2.8739052e-07 | R4 qa/browser_large_mean_tail_control.json;60digit Decimal/Stirling/geometric-remainder calculation, not empirical data. |
| 1000000 | 1005005 | 2.859076e-07 | 2.859076e-07 | 2.6023628e-13 | 2.859063e-07 | R4 qa/browser_large_mean_tail_control.json;60digit Decimal/Stirling/geometric-remainder calculation, not empirical data. |
4 rows total; 4 shown.
| kind | mean | n_inclusive | direct_sum | SciPy | abs_difference | relative_difference |
|---|
| Poisson_tail | 0 | 0 | 1 | 1 | 0 | 0 |
| Poisson_tail | 0 | 1 | 0 | 0 | 0 | None |
| Poisson_tail | 0 | 5 | 0 | 0 | 0 | None |
| Poisson_tail | 1e-12 | 0 | 1 | 1 | 0 | 0 |
| Poisson_tail | 1e-12 | 1 | 1e-12 | 1e-12 | 2.6253291e-27 | 2.6645353e-15 |
| Poisson_tail | 1e-12 | 5 | 8.3333333e-63 | 8.3333333e-63 | 9.2838812e-77 | 1.110223e-14 |
| Poisson_tail | 0.01 | 0 | 1 | 1 | 0 | 0 |
| Poisson_tail | 0.01 | 1 | 0.0099501663 | 0.0099501663 | 5.2041704e-18 | 5.5511151e-16 |
| Poisson_tail | 0.01 | 5 | 8.2641856e-13 | 8.2641856e-13 | 5.149684e-27 | 6.2172489e-15 |
| Poisson_tail | 0.1 | 0 | 1 | 1 | 0 | 0 |
| Poisson_tail | 0.1 | 1 | 0.095162582 | 0.095162582 | 1.3877788e-17 | 1.110223e-16 |
| Poisson_tail | 0.1 | 5 | 7.6678017e-08 | 7.6678017e-08 | 9.2644229e-23 | 1.2212453e-15 |
35 rows total; 12 shown.
Cell 20 · statistics-20
Known-parameter oracle — S20–S21
For known independent Poisson means, . Under equal priors and zero-one loss:
Inspect original LaTeX
(1-\sqrt{1-{\rm BC}^2})/2\le P_e^\star\le{\rm BC}/2.
Three new small two-bin joint-PMF controls test the formula and bounds. The original 320-row grid is not independently rebuilt here. Unknown nuisance fits and accepted-only practical errors have different assumptions and loss/selection rules.
Cell 21 · statistics-21 · execution 11
table(audit["oracle_affinity"]["rows"], max_rows=3)
print("Original 320-row grid:", audit["oracle_affinity"]["retained320_grid"])
| mu_PE_per_bin | nu_PE_per_bin | explicit_joint_PMF_affinity | explicit_equal_prior_Bayes_error | affinity | Bayes_error_lower | Bayes_error_upper | finite_grid_mass_P | finite_grid_mass_Q |
|---|
| [0.2, 1.0] | [1.3, 2.5] | 0.66434132 | 0.182032 | 0.66434132 | 0.12628533 | 0.33217066 | 1 | 1 |
| [0.0, 0.3] | [0.2, 1.0] | 0.81686826 | 0.280188 | 0.81686826 | 0.21158786 | 0.40843413 | 1 | 1 |
| [1.0, 0.1] | [1.0, 3.0] | 0.36704257 | 0.072474825 | 0.36704257 | 0.034897927 | 0.18352129 | 1 | 1 |
3 rows total; 3 shown.
Original 320-row grid: NOT_INDEPENDENTLY_REBUILT_IN_THIS_LIGHT_REVIEW
Cell 22 · statistics-22
Source-function audit and optional browser execution
Retaining original code is provenance; running it twice is not independent theory validation. The likelihood is derived in the methods chapter, and this new profile is checked against direct two-parameter optimization.
The browser copy is linked by hash/function lines. Optional actual Node checks exercise thresholds, red limits and the corrected tiny-background boundary. NOT_RUN means JavaScript was not executed in this environment.
Cell 23 · statistics-23 · execution 12
for row in audit["source_map"]:
print(json.dumps(row, indent=2))
print(json.dumps({k:v for k,v in audit["javascript"].items() if k != "checks"}, indent=2))
table(audit["javascript"].get("checks", []), max_rows=12)
equations = []
for eq, funcs in audit["equation_function_map"].items():
for f in funcs:
equations.append({"equation": eq, **f})
table(equations, max_rows=40)
{
"file": "reference\\statistics\\oracle_reference\\calculate_ideal_poisson_rise.py",
"present": true,
"sha256": "542d4cc4495b0e7d379b3d6071bc668d904533567638ccca35853ac56abc3269",
"functions": {
"experiment": 18,
"affinity_bounds": 28
}
}
{
"file": "reference\\statistics\\practical_morphology.py",
"present": true,
"sha256": "08df8f61294885ba658d75ae23bc3a7bb6511ffd01f9608a0de5a143f33f477c",
"functions": {
"primitive": 25,
"fit_one": 57,
"draw_case": 138,
"analyze_case": 154
}
}
{
"file": "reference\\statistics\\count_inference\\count_inference.py",
"present": true,
"sha256": "4e4e25ae4db608500fb51c8406b599a7ee8efb92a3adee0f49e8a6d2a45eba9c",
"functions": {
"count_threshold_known_background": 78,
"exact_onoff_pvalue": 96,
"poisson_total_mean_upper": 133,
"poisson_total_mean_lower": 140,
"red_source_upper_known_background": 147,
"red_source_upper_finite_baseline": 156
}
}
{
"file": "reference\\statistics\\browser_math.js",
"sha256": "69186918327b076b053769ad3597c3f472a93919e5cd73057303f8034704bd37",
"function_lines": {
"sf": 5,
"critical": 7,
"threshold": 8,
"upper": 9
},
"status": "EXECUTED_OPTIONAL_NODE",
"node_version": "v24.19.0",
"red_upper_checks": [
{
"n_on": 0,
"b_on_PE": 0,
"JS_upper95": 2.995732273553991,
"Python_upper95": 2.9957322735539913,
"abs_difference": 4.440892098500626e-16
},
{
"n_on": 0,
"b_on_PE": 2,
"JS_upper95": 0.9957322735539909,
"Python_upper95": 0.9957322735539913,
"abs_difference": 4.440892098500626e-16
},
{
"n_on": 1,
"b_on_PE": 0,
"JS_upper95": 4.743864518390579,
"Python_upper95": 4.743864518390579,
"abs_difference": 0.0
},
{
"n_on": 3,
"b_on_PE": 2,
"JS_upper95": 5.753656527932727,
"Python_upper95": 5.753656527932727,
"abs_difference": 0.0
},
{
"n_on": 10,
"b_on_PE": 5,
"JS_upper95": 11.962219235721907,
"Python_upper95": 11.962219235721896,
"abs_difference": 1.0658141036401503e-14
},
{
"n_on": 100,
"b_on_PE": 80,
"JS_upper95": 38.07927278209726,
"Python_upper95": 38.079272782097064,
"abs_difference": 1.9895196601282805e-13
}
],
"tiny_background_boundary_checks": [
{
"b_PE": 2.8665161009724685e-07,
"alpha": 2.866515718791933e-07,
"JS": {
"sf1": 2.86651569012678e-07,
"critical": 1
},
"expected_sf1": 2.86651569012678e-07,
"expected_critical": 1
},
{
"b_PE": 2.866516158302791e-07,
"alpha": 2.866515718791933e-07,
"JS": {
"sf1": 2.8665157474570857e-07,
"critical": 2
},
"expected_sf1": 2.8665157474570857e-07,
"expected_critical": 2
},
{
"b_PE": 7.716049305585323e-12,
"alpha": 7.716049382716049e-12,
"JS": {
"sf1": 7.716049305555554e-12,
"critical": 1
},
"expected_sf1": 7.716049305555554e-12,
"expected_critical": 1
},
{
"b_PE": 7.716049459906311e-12,
"alpha": 7.716049382716049e-12,
"JS": {
"sf1": 7.716049459876542e-12,
"critical": 2
},
"expected_sf1": 7.716049459876542e-12,
"expected_critical": 2
}
]
}
| b_PE | alpha | JS | Python | signal_abs_difference |
|---|
| 0 | 2.8665157e-07 | {"critical": 1, "signal": 2.995732273553989, "power": 0.95, "tail": 0} | {"critical": 1, "source_mean_PE": 2.995732273553991, "background_mean_PE": 0.0, "power": 0.95, "tail": 0.0} | 1.7763568e-15 |
| 0 | 7.7160494e-12 | {"critical": 1, "signal": 2.995732273553989, "power": 0.95, "tail": 0} | {"critical": 1, "source_mean_PE": 2.995732273553991, "background_mean_PE": 0.0, "power": 0.95, "tail": 0.0} | 1.7763568e-15 |
| 0.01 | 2.8665157e-07 | {"critical": 3, "signal": 6.285793621871987, "power": 0.95, "tail": 1.6542165280748786e-07} | {"critical": 3, "source_mean_PE": 6.285793621871989, "background_mean_PE": 0.01, "power": 0.95, "tail": 1.6542165280748778e-07} | 2.6645353e-15 |
| 0.01 | 7.7160494e-12 | {"critical": 5, "signal": 9.143519026637575, "power": 0.95, "tail": 8.264185641806491e-13} | {"critical": 5, "source_mean_PE": 9.143519026637573, "background_mean_PE": 0.01, "power": 0.95, "tail": 8.264185641806515e-13} | 1.7763568e-15 |
| 1 | 2.8665157e-07 | {"critical": 10, "signal": 14.705216422115452, "power": 0.95, "tail": 1.1142547833872041e-07} | {"critical": 10, "source_mean_PE": 14.705216422115463, "background_mean_PE": 1.0, "power": 0.9499999999999998, "tail": 1.1142547833872071e-07} | 1.0658141e-14 |
| 1 | 7.7160494e-12 | {"critical": 14, "signal": 19.668569075713677, "power": 0.95, "tail": 4.519852546965104e-12} | {"critical": 14, "source_mean_PE": 19.668569075713705, "background_mean_PE": 1.0, "power": 0.9500000000000001, "tail": 4.519852546965122e-12} | 2.8421709e-14 |
| 10 | 2.8665157e-07 | {"critical": 30, "signal": 29.540972243924358, "power": 0.9500000000000001, "tail": 2.5099512015279526e-07} | {"critical": 30, "source_mean_PE": 29.540972243924372, "background_mean_PE": 10.0, "power": 0.95, "tail": 2.509951201527959e-07} | 1.4210855e-14 |
| 10 | 7.7160494e-12 | {"critical": 39, "signal": 39.808463662141904, "power": 0.9500000000000001, "tail": 2.9598814575402454e-12} | {"critical": 39, "source_mean_PE": 39.80846366214213, "background_mean_PE": 10.0, "power": 0.9500000000000028, "tail": 2.9598814575402995e-12} | 2.2737368e-13 |
| 1000 | 2.8665157e-07 | {"critical": 1163, "signal": 219.65682567491922, "power": 0.9500000000000111, "tail": 2.6749344185905257e-07} | {"critical": 1163, "source_mean_PE": 219.65682567495128, "background_mean_PE": 1000.0, "power": 0.9500000000000016, "tail": 2.674934418591886e-07} | 3.2059688e-11 |
| 1000 | 7.7160494e-12 | {"critical": 1222, "signal": 280.06221661812697, "power": 0.9500000000000106, "tail": 6.339480605104741e-12} | {"critical": 1222, "source_mean_PE": 280.06221661811855, "background_mean_PE": 1000.0, "power": 0.9499999999999994, "tail": 6.339480605102249e-12} | 8.412826e-12 |
| 1000000 | 2.8665157e-07 | {"critical": 1005005, "signal": 6654.5330544832395, "power": 0.9500000000931117, "tail": 2.8590760129493844e-07} | {"critical": 1005005, "source_mean_PE": 6654.533054276719, "background_mean_PE": 1000000.0, "power": 0.9500000000000056, "tail": 2.859062985845651e-07} | 2.0652078e-07 |
| 1000000 | 7.7160494e-12 | {"critical": 1006752, "signal": 8402.965629891492, "power": 0.9500000000003141, "tail": 7.699419230852799e-12} | {"critical": 1006752, "source_mean_PE": 8402.96562969836, "background_mean_PE": 1000000.0, "power": 0.9499999999999954, "tail": 7.699418061156473e-12} | 1.9313302e-07 |
12 rows total; 12 shown.
| equation | file | function | line |
|---|
| S01 | modules/statistics_review.py | photon_planes | 199 |
| S02 | modules/statistics_review.py | photon_planes | 199 |
| S03 | modules/statistics_review.py | onoff_pvalue | 88 |
| S04 | modules/statistics_review.py | onoff_pvalue | 88 |
| S05 | modules/statistics_review.py | critical_known | 65 |
| S06 | modules/statistics_review.py | required_signal_known | 77 |
| S07 | modules/statistics_review.py | onoff_pvalue | 88 |
| S07 | modules/statistics_review.py | direct_onoff_tail | 94 |
| S08 | modules/statistics_review.py | count_checks | 210 |
| S09 | modules/statistics_review.py | source_upper_known | 103 |
| S10 | modules/statistics_review.py | source_upper_known | 103 |
| S11 | modules/statistics_review.py | source_upper_off | 107 |
| S12 | modules/statistics_review.py | source_upper_off | 107 |
| S13 | modules/statistics_review.py | q_integrals | 131 |
| S13 | modules/statistics_review.py | poisson_loglik | 134 |
| S14 | modules/statistics_review.py | nuisance_profile | 139 |
| S15 | modules/statistics_review.py | nuisance_profile | 139 |
| S16 | modules/statistics_review.py | nuisance_profile | 139 |
| S16 | modules/statistics_review.py | worked_example | 156 |
| S17 | modules/statistics_review.py | confusion_checks | 272 |
| S18 | modules/statistics_review.py | mc_intervals | 115 |
| S19 | modules/statistics_review.py | mc_intervals | 115 |
| S20 | modules/statistics_review.py | affinity_bound_values | 386 |
| S21 | modules/statistics_review.py | oracle_affinity_controls | 394 |
24 rows total; 24 shown.
Cell 24 · statistics-24
Interpretation limits
- kS/s specifies integration spacing, not analog noise bandwidth.
- Analog post-counting filtering generally correlates samples; it is absent from the independent-Poisson shape model.
- Deadtime flags do not restore missing photons or Poisson statistics.
- Red limits require calibration/live time and a separately justified thermal-alternative criterion.
- Pulse labels describe expected received rate after transport, not intrinsic histories or known depths.
- Physical populations, exposure, model mismatch and flight hardware remain unvalidated. Useful mission rate is not computable from these inputs.
Expected controls: 2.995732 PE known-zero-background upper limit; 3.688879 PE specified finite-baseline zero/zero bound; 81 scenarios, 81,000 saved pulses and 648 rebuilt metrics. Worked log-likelihood difference tolerance is ; interval differences must be below .