[][src]Struct changepoint::BocpdTruncated

pub struct BocpdTruncated<X, H, Fx, Pr> where
    H: Fn(usize) -> f64,
    Fx: Rv<X> + HasSuffStat<X>,
    Pr: ConjugatePrior<X, Fx>,
    Fx::Stat: Clone
{ /* fields omitted */ }

Online Bayesian Change Point Detection with a truncated tail

The truncation takes place after run length probabilites are computed. The truncation point is chosen based on the most recent point from which all successive mass is below the given threshold.

Implementations

impl<X, H, Fx, Pr> BocpdTruncated<X, H, Fx, Pr> where
    H: Fn(usize) -> f64,
    Fx: Rv<X> + HasSuffStat<X>,
    Pr: ConjugatePrior<X, Fx>,
    Fx::Stat: Clone
[src]

pub fn new(hazard: H, fx: Fx, predictive_prior: Pr) -> Self[src]

Create a new Bocpd analyzer

Parameters

  • hazard - The hazard function for P_{gap}.
  • fx - Predictive distribution. Used for generating an empty SuffStat.
  • predictive_prior - Prior for the predictive distribution.

Example

use changepoint::{BocpdTruncated, constant_hazard};
use rv::prelude::*;
use std::sync::Arc;

let cpd = BocpdTruncated::new(
    constant_hazard(250.0),
    Gaussian::standard(),
    NormalGamma::new_unchecked(0.0, 1.0, 1.0, 1.0),
);

pub fn with_cutoff(self, cutoff_threadhold: f64) -> Self[src]

Change the cutoff for mass to be discarded on the tail end of run-lengths

Trait Implementations

impl<X, H, Fx, Pr> RunLengthDetector<X> for BocpdTruncated<X, H, Fx, Pr> where
    H: Fn(usize) -> f64,
    Fx: Rv<X> + HasSuffStat<X>,
    Pr: ConjugatePrior<X, Fx>,
    Fx::Stat: Clone
[src]

fn step(&mut self, data: &X) -> &[f64][src]

Update the model with a new datum and return the distribution of run lengths.

Auto Trait Implementations

impl<X, H, Fx, Pr> RefUnwindSafe for BocpdTruncated<X, H, Fx, Pr> where
    H: RefUnwindSafe,
    Pr: RefUnwindSafe,
    <Fx as HasSuffStat<X>>::Stat: RefUnwindSafe

impl<X, H, Fx, Pr> Send for BocpdTruncated<X, H, Fx, Pr> where
    H: Send,
    Pr: Send,
    <Fx as HasSuffStat<X>>::Stat: Send

impl<X, H, Fx, Pr> Sync for BocpdTruncated<X, H, Fx, Pr> where
    H: Sync,
    Pr: Sync,
    <Fx as HasSuffStat<X>>::Stat: Sync

impl<X, H, Fx, Pr> Unpin for BocpdTruncated<X, H, Fx, Pr> where
    H: Unpin,
    Pr: Unpin,
    <Fx as HasSuffStat<X>>::Stat: Unpin

impl<X, H, Fx, Pr> UnwindSafe for BocpdTruncated<X, H, Fx, Pr> where
    H: UnwindSafe,
    Pr: UnwindSafe,
    <Fx as HasSuffStat<X>>::Stat: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,