pub struct PowerLawOffset;Expand description
Power-law with offset: amplitude · (offset + x)^(−1/shape)
Parameters (in order): [amplitude, offset, shape]
This is the NIST StRD Bennett5 model. It describes a power-law relationship
of the form y = b1·(b2 + x)^(−1/b3) with the mapping:
amplitude= b1 (≈ −2524 for Bennett5; may be negative)offset= b2 (≈ 46.7 for Bennett5; shifts x-origin)shape= b3 (≈ 0.932 for Bennett5; controls the exponent)
Domain guard: u = offset + x must be strictly positive so that ln(u)
and u^p (with p = −1/shape) are finite. If u ≤ 0 the function returns
f64::NAN (the LM solver will reject the step and backtrack).
Note: amplitude is the overall scale, NOT a peak-at-center value as in
the spectral-peak convention documented in docs/reference/models/index.md. For Bennett5 the
certified b1 is large and negative.
Analytic Jacobian (let u = offset + x, p = −1/shape):
- ∂y/∂amplitude = u^p
- ∂y/∂offset = amplitude · p · u^(p−1)
- ∂y/∂shape = amplitude · u^p · ln(u) · (1/shape²)
Trait Implementations§
Source§impl Model for PowerLawOffset
impl Model for PowerLawOffset
Source§fn jacobian_into(&self, x: &[f64], p: &[f64], out: &mut [f64])
fn jacobian_into(&self, x: &[f64], p: &[f64], out: &mut [f64])
Fill a pre-allocated slice with Jacobian values (one entry per parameter). Read more
Source§fn jacobian(&self, x: &[f64], p: &[f64]) -> Vec<f64>
fn jacobian(&self, x: &[f64], p: &[f64]) -> Vec<f64>
Jacobian — one derivative per parameter, in the same order as
param_names(). Read moreSource§fn eval_slice_into(&self, xs: &[f64], params: &[f64], out: &mut [f64])
fn eval_slice_into(&self, xs: &[f64], params: &[f64], out: &mut [f64])
Batch evaluation of a 1-D model: fill
out[i] = eval([xs[i]], params). Read moreAuto Trait Implementations§
impl Freeze for PowerLawOffset
impl RefUnwindSafe for PowerLawOffset
impl Send for PowerLawOffset
impl Sync for PowerLawOffset
impl Unpin for PowerLawOffset
impl UnsafeUnpin for PowerLawOffset
impl UnwindSafe for PowerLawOffset
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