[][src]Struct changepoint::BOCPD

pub struct BOCPD<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 state container

Methods

impl<X, H, Fx, Pr> BOCPD<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: Arc<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::{BOCPD, constant_hazard};
use rv::prelude::*;
use std::sync::Arc;

let cpd = BOCPD::new(
    constant_hazard(250.0),
    &Gaussian::standard(),
    Arc::new(NormalGamma::new(0.0, 1.0, 1.0, 1.0).unwrap()),
);

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

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

Auto Trait Implementations

impl<X, H, Fx, Pr> Sync for BOCPD<X, H, Fx, Pr> where
    H: Sync,
    Pr: Send + Sync,
    <Fx as HasSuffStat<X>>::Stat: Sync

impl<X, H, Fx, Pr> Send for BOCPD<X, H, Fx, Pr> where
    H: Send,
    Pr: Send + Sync,
    <Fx as HasSuffStat<X>>::Stat: Send

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

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

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

Blanket Implementations

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

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

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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[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>,