pub struct LogNormal;Expand description
Log-normal peak: A · exp(−(ln(x/c))² / (2σ²)) for x > 0, else 0.
Parameters (in order): [amplitude, center, sigma]
amplitudeis the peak height attained atx == center.center > 0is the peak location (log-space mode).sigmais the log-space width.
The kernel is defined only for x > 0; at x <= 0 it returns 0.0 (the
log argument is undefined there). The numpy benchmark formula is identical —
np.where(x > 0, A·exp(−(ln(x/c))²/(2σ²)), 0) — so numpy↔Rust parity is exact.
Trait Implementations§
Source§impl Model for LogNormal
impl Model for LogNormal
Source§fn jacobian(&self, x: &[f64], params: &[f64]) -> Vec<f64>
fn jacobian(&self, x: &[f64], params: &[f64]) -> Vec<f64>
Central finite-difference Jacobian.
The closed form has a logarithmic singularity at x == 0, so a numerical
(central-difference) Jacobian is used rather than an analytical one. Step
h = 1e-7 · |p[i]|.max(1e-7) (relative + absolute floor), matching the
trait’s default magnitude.
Source§fn jacobian_into(&self, x: &[f64], params: &[f64], out: &mut [f64])
fn jacobian_into(&self, x: &[f64], params: &[f64], out: &mut [f64])
Fill a pre-allocated slice with Jacobian values (one entry per parameter). Read more
Source§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 LogNormal
impl RefUnwindSafe for LogNormal
impl Send for LogNormal
impl Sync for LogNormal
impl Unpin for LogNormal
impl UnsafeUnpin for LogNormal
impl UnwindSafe for LogNormal
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