pub enum RobustLikelihood {
Gaussian,
StudentT {
degrees_of_freedom: f64,
},
Laplace {
scale: f64,
},
Huber {
threshold: f64,
},
Cauchy {
scale: f64,
},
ContaminationMixture {
clean_variance: f64,
contamination_variance: f64,
contamination_probability: f64,
},
Adaptive {
base_likelihood: Box<RobustLikelihood>,
adaptation_rate: f64,
},
}Expand description
Types of robust likelihood functions
Variants§
Gaussian
Standard Gaussian likelihood (not robust)
StudentT
Student-t likelihood with specified degrees of freedom
Laplace
Laplace (double exponential) likelihood
Huber
Huber likelihood (combination of Gaussian and Laplace)
Cauchy
Cauchy likelihood (very heavy-tailed)
ContaminationMixture
Mixture of Gaussians for contamination modeling
Adaptive
Adaptive likelihood that learns the appropriate robustness
Implementations§
Source§impl RobustLikelihood
impl RobustLikelihood
Sourcepub fn contamination_mixture(
clean_var: f64,
contam_var: f64,
contam_prob: f64,
) -> Self
pub fn contamination_mixture( clean_var: f64, contam_var: f64, contam_prob: f64, ) -> Self
Create a contamination mixture likelihood
Sourcepub fn log_likelihood(&self, residual: f64) -> f64
pub fn log_likelihood(&self, residual: f64) -> f64
Compute log likelihood for a single residual
Sourcepub fn log_likelihood_derivative(&self, residual: f64) -> f64
pub fn log_likelihood_derivative(&self, residual: f64) -> f64
Compute the derivative of log likelihood (for optimization)
Sourcepub fn compute_weights(&self, residuals: &Array1<f64>) -> Array1<f64>
pub fn compute_weights(&self, residuals: &Array1<f64>) -> Array1<f64>
Compute robust weights for each data point
Sourcepub fn breakdown_point(&self) -> f64
pub fn breakdown_point(&self) -> f64
Get the theoretical breakdown point of the likelihood
Trait Implementations§
Source§impl Clone for RobustLikelihood
impl Clone for RobustLikelihood
Source§fn clone(&self) -> RobustLikelihood
fn clone(&self) -> RobustLikelihood
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RobustLikelihood
impl RefUnwindSafe for RobustLikelihood
impl Send for RobustLikelihood
impl Sync for RobustLikelihood
impl Unpin for RobustLikelihood
impl UnwindSafe for RobustLikelihood
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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