Skip to main content

baseline_reference_energy

Function baseline_reference_energy 

Source
pub fn baseline_reference_energy(energies: &[f64]) -> f64
Expand description

Reference energy for the multiplicative-baseline log basis: the geometric midpoint √(E_min · E_max) of the grid. Centering the basis at the geometric midpoint makes the design columns 1, z, z² near-orthogonal on a log-uniform grid and makes b0 the mid-grid baseline value — so its bound is directly the “a few % off unity” statement from the VENUS data.

The caller must guarantee a non-empty grid of positive energies (the pipeline validates this); on an empty grid this returns NaN, which the config validation rejects downstream. The actual extrema are folded over the slice rather than read from first()/last(), so the documented √(E_min·E_max) holds regardless of grid ordering (the pipeline convention is ascending, but UnifiedFitConfig::new does not enforce it and the two forms agree bit-exactly on any monotonic grid).