pub enum CostFunction {
L2,
Normal,
}Expand description
Cost function for evaluating segment homogeneity.
Variants§
L2
Detects changes in mean only.
Segment cost: sum((y_i - y_bar)^2) where y_bar is the segment mean.
Equivalent to minus log-likelihood of a normal model with known variance.
One parameter per segment (mean).
Normal
Detects changes in mean and/or variance.
Segment cost: n * ln(sigma^2_MLE) where sigma^2_MLE = sum((y_i - y_bar)^2) / n.
Derived from the negative log-likelihood of a normal distribution
with both mean and variance estimated by MLE.
Two parameters per segment (mean, variance).
Trait Implementations§
Source§impl Clone for CostFunction
impl Clone for CostFunction
Source§fn clone(&self) -> CostFunction
fn clone(&self) -> CostFunction
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 moreSource§impl Debug for CostFunction
impl Debug for CostFunction
Source§impl PartialEq for CostFunction
impl PartialEq for CostFunction
impl Copy for CostFunction
impl Eq for CostFunction
impl StructuralPartialEq for CostFunction
Auto Trait Implementations§
impl Freeze for CostFunction
impl RefUnwindSafe for CostFunction
impl Send for CostFunction
impl Sync for CostFunction
impl Unpin for CostFunction
impl UnsafeUnpin for CostFunction
impl UnwindSafe for CostFunction
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