pub struct CountsBackgroundScaleModel<'a> {
pub transmission_model: &'a dyn FitModel,
pub flux: &'a [f64],
pub background: &'a [f64],
pub alpha1_index: usize,
pub alpha2_index: usize,
pub n_params: usize,
}Expand description
Counts model with optional nuisance scaling of signal and detector background.
Given a transmission model T(θ), predicts:
Y(E) = α₁ · [Φ(E) · T(θ)] + α₂ · B(E)
where α₁ and α₂ are parameter-vector entries.
Fields§
§transmission_model: &'a dyn FitModelUnderlying transmission model.
flux: &'a [f64]Incident flux spectrum.
background: &'a [f64]Detector background spectrum.
alpha1_index: usizeIndex of α₁ in the parameter vector.
alpha2_index: usizeIndex of α₂ in the parameter vector.
n_params: usizeTotal parameter count in the wrapped model.
Trait Implementations§
Source§impl<'a> FitModel for CountsBackgroundScaleModel<'a>
impl<'a> FitModel for CountsBackgroundScaleModel<'a>
Source§fn evaluate(&self, params: &[f64]) -> Result<Vec<f64>, FittingError>
fn evaluate(&self, params: &[f64]) -> Result<Vec<f64>, FittingError>
Evaluate the model for the given parameters. Read more
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>
Optionally provide an analytical Jacobian. Read more
Source§impl<'a> ForwardModel for CountsBackgroundScaleModel<'a>
impl<'a> ForwardModel for CountsBackgroundScaleModel<'a>
Auto Trait Implementations§
impl<'a> Freeze for CountsBackgroundScaleModel<'a>
impl<'a> !RefUnwindSafe for CountsBackgroundScaleModel<'a>
impl<'a> !Send for CountsBackgroundScaleModel<'a>
impl<'a> !Sync for CountsBackgroundScaleModel<'a>
impl<'a> Unpin for CountsBackgroundScaleModel<'a>
impl<'a> !UnwindSafe for CountsBackgroundScaleModel<'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
Mutably borrows from an owned value. Read more
§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>
Converts
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>
Converts
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