pub struct CountsModel<'a> {
pub transmission_model: &'a dyn FitModel,
pub flux: &'a [f64],
pub background: &'a [f64],
pub n_params: usize,
}Expand description
Fixed-flux counts-domain forward model: Y_model = flux × T_model(θ) + background.
Retained for the research Fisher helper, not for production fitting.
The production counts-KL dispatch (SolverConfig::PoissonKL on
InputData::Counts / InputData::CountsWithNuisance) goes through
the joint-Poisson conditional-binomial-deviance path in
crate::joint_poisson per memo 35 §P1/§P2. CountsModel and
CountsBackgroundScaleModel below are consumed only by
nereids_pipeline::pipeline::evaluate_jacobian_and_fisher (the
Fisher-info research helper used by the spatial-regularization
epic #394) and by this module’s #[cfg(test)] tests. They assume
the caller has pre-computed flux = c · O (i.e. c is baked into
flux — the convention that memo 35 §P1 flagged as error-prone for
end users, which is precisely why the production path no longer
uses this struct).
The flux and background slices must have the same length as the
transmission vector returned by the inner model. In debug builds,
evaluate() asserts this invariant.
Fields§
§transmission_model: &'a dyn FitModelUnderlying transmission model.
flux: &'a [f64]Incident flux (counts per bin in open beam, after normalization).
background: &'a [f64]Background counts per bin.
n_params: usizeTotal parameter count in the wrapped model.
Trait Implementations§
Source§impl<'a> FitModel for CountsModel<'a>
impl<'a> FitModel for CountsModel<'a>
Source§fn analytical_jacobian(
&self,
params: &[f64],
free_param_indices: &[usize],
y_current: &[f64],
) -> Option<FlatMatrix>
fn analytical_jacobian( &self, params: &[f64], free_param_indices: &[usize], y_current: &[f64], ) -> Option<FlatMatrix>
Analytical Jacobian: ∂Y/∂θ = flux · ∂T_inner/∂θ.
Background is constant w.r.t. θ and drops out.
Source§impl<'a> ForwardModel for CountsModel<'a>
impl<'a> ForwardModel for CountsModel<'a>
Auto Trait Implementations§
impl<'a> Freeze for CountsModel<'a>
impl<'a> !RefUnwindSafe for CountsModel<'a>
impl<'a> !Send for CountsModel<'a>
impl<'a> !Sync for CountsModel<'a>
impl<'a> Unpin for CountsModel<'a>
impl<'a> UnsafeUnpin for CountsModel<'a>
impl<'a> !UnwindSafe for CountsModel<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more