pub struct Huber { /* private fields */ }Expand description
Huber’s loss with tuning k (default 1.345, ≈ 95% Gaussian efficiency).
ρ(r) = r²/2 for |r| ≤ k, else k|r| − k²/2.
Implementations§
Trait Implementations§
impl Copy for Huber
Source§impl RhoFunction for Huber
impl RhoFunction for Huber
Source§fn psi(&self, r: f64) -> f64
fn psi(&self, r: f64) -> f64
The score
ψ(r) = ρ'(r): the (unstandardized) influence-function shape.Source§fn weight(&self, r: f64) -> f64
fn weight(&self, r: f64) -> f64
The IRLS weight
w(r) = ψ(r)/r, with the removable singularity at
r = 0 resolved by the limit ψ'(0).Source§fn psi_prime(&self, r: f64) -> f64
fn psi_prime(&self, r: f64) -> f64
The derivative
ψ'(r) = ρ''(r): the curvature of the loss and the shape
of the E[ψ'] term in the asymptotic variance. (That E[ψ'] is computed
via Stein’s identity E[X·ψ(X)], not by integrating this, so kinked
scores stay exact; psi_prime is exposed for callers and completeness.)Source§fn tuning(&self) -> f64
fn tuning(&self) -> f64
The tuning constant controlling the efficiency/robustness trade-off
(
f64::NAN for losses without one, e.g. L1/least squares).Source§fn is_redescending(&self) -> bool
fn is_redescending(&self) -> bool
Whether
ψ redescends to zero (⇒ ρ non-convex ⇒ needs a good start).Auto Trait Implementations§
impl Freeze for Huber
impl RefUnwindSafe for Huber
impl Send for Huber
impl Sync for Huber
impl Unpin for Huber
impl UnsafeUnpin for Huber
impl UnwindSafe for Huber
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
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