Struct bayes_estimate::estimators::sir::SampleState[][src]

pub struct SampleState<N: RealField, D: Dim> where
    DefaultAllocator: Allocator<N, D>, 
{ pub s: Samples<N, D>, pub w: Likelihoods, pub rng: Box<dyn RngCore>, }

Sample state.

State distribution is represented as state samples and their likelihood.

Fields

s: Samples<N, D>

State samples

w: Likelihoods

and their likelihoods (bootstrap weights)

rng: Box<dyn RngCore>

A PRNG use to draw random samples

Implementations

impl<N: RealField, D: Dim> SampleState<N, D> where
    DefaultAllocator: Allocator<N, D, D> + Allocator<N, D>, 
[src]

pub fn new_equal_likelihood(
    s: Vec<VectorN<N, D>>,
    rng: Box<dyn RngCore>
) -> SampleState<N, D>
[src]

pub fn predict(&mut self, f: fn(_: &VectorN<N, D>) -> VectorN<N, D>)[src]

Predict state using a state prediction function ‘f’.

pub fn predict_sampled(
    &mut self,
    f: impl Fn(&VectorN<N, D>, &mut dyn RngCore) -> VectorN<N, D>
)
[src]

pub fn observe<LikelihoodFn>(&mut self, l: LikelihoodFn) where
    LikelihoodFn: Fn(&VectorN<N, D>) -> f32
[src]

Observe sample likehoods using a likelihood function ‘l’. The sample likelihoods are multiplied by the observed likelihoods.

pub fn observe_likelihood(&mut self, l: Likelihoods)[src]

Observe sample likehoods directly. The sample likelihoods are multiplied by these likelihoods.

pub fn update_resample(
    &mut self,
    resampler: &mut Resampler,
    roughener: &mut Roughener<N, D>
) -> Result<(u32, f32), &'static str>
[src]

Resample using likelihoods and roughen the sample state. Error returns: When the resampler fails due to numeric problems with the likelihoods Returns: number of unique samples, smallest normalised likelohood, to determine numerical conditioning of likehoods

pub fn roughen_minmax(s: &mut Vec<VectorN<N, D>>, k: f32, rng: &mut dyn RngCore)[src]

Min max roughening.

Uses algorithm from Ref[1]. max-min in each state dimension in the samples determines the amount of normally distrubuted noise added to that dimension for each sample.

‘k’ is scaling factor for normally distributed noise

Numerics: If the are very few unique samples the roughening will colapse as it is not representative of the true state distribution.

Trait Implementations

impl<N: RealField, D: Dim> Estimator<N, D> for SampleState<N, D> where
    DefaultAllocator: Allocator<N, D>, 
[src]

impl<N: RealField, D: Dim> KalmanEstimator<N, D> for SampleState<N, D> where
    DefaultAllocator: Allocator<N, D, D> + Allocator<N, U1, D> + Allocator<N, D>, 
[src]

Auto Trait Implementations

impl<N, D> !RefUnwindSafe for SampleState<N, D>

impl<N, D> !Send for SampleState<N, D>

impl<N, D> !Sync for SampleState<N, D>

impl<N, D> !Unpin for SampleState<N, D>

impl<N, D> !UnwindSafe for SampleState<N, D>

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>,