Skip to main content

Module joint_poisson

Module joint_poisson 

Source
Expand description

Joint-Poisson counts-path objective with profiled flux.

This module implements the joint-Poisson conditional binomial deviance derived in .research/spatial-regularization/evidence/32-counts-path-governing-equations-v2.md (equations §4.1, §5.7, §6.2b) and validated experimentally in memo 35 §P1. It supersedes the fixed-flux Poisson NLL (poisson.rs) for the counts-path fitter.

§Model

Under the λ-at-sample convention with proton-charge ratio c = Q_s / Q_ob:

  • O_i ~ Poisson(λ_i / c) (open-beam counts)
  • S_i ~ Poisson(λ_i · T_i) (sample counts)

Profiling out λ_i bin-by-bin gives the closed-form MLE

λ̂_i = c · (O_i + S_i) / (1 + c · T_i)

The profile-conditional log-likelihood is equivalent (up to constants) to a Binomial S_i | N_i = O_i + S_i ~ Binomial(N_i, p_i) with

p_i = c · T_i / (1 + c · T_i)

The conditional deviance is

D(θ) = 2 · Σ_i [ S_i · ln(S_i / (N_i · p_i))
               + O_i · ln(O_i / (N_i · (1 − p_i))) ]

with the x · ln(x / 0) → 0 convention when x = 0.

Under the correct model, D / (n − k) → 1 as n → ∞ — this replaces the fixed-flux Pearson χ²/dof reported from the old Poisson path (which scaled with c at constant density fidelity; see memo 35 headline).

Structs§

JointPoissonFitConfig
Configuration for joint_poisson_fit.
JointPoissonObjective
Joint-Poisson objective.
JointPoissonResult
Outcome of joint_poisson_fit.

Functions§

joint_poisson_fit
Two-stage joint-Poisson fit: damped Fisher stage followed by Nelder-Mead polish.