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>, }
Expand description
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>,
impl<N: RealField, D: Dim> SampleState<N, D> where
DefaultAllocator: Allocator<N, D, D> + Allocator<N, D>,
Creates a SampleState with equal likelihood weights.
Predict sample state using a state prediction function ‘f’.
Predict sample state using a sampled state prediction function ‘f’. The sampling function should predict the state and sample any noise.
Observe sample likehoods using a likelihood function ‘l’. The sample likelihoods are multiplied by the observed likelihoods.
Observe sample likehoods directly. The sample likelihoods are multiplied by these likelihoods.
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
Trait Implementations
impl<N: FromPrimitive + RealField, D: Dim> Estimator<N, D> for SampleState<N, D> where
DefaultAllocator: Allocator<N, D>,
impl<N: FromPrimitive + RealField, D: Dim> Estimator<N, D> for SampleState<N, D> where
DefaultAllocator: Allocator<N, D>,
impl<N: Copy + FromPrimitive + RealField, D: Dim> KalmanEstimator<N, D> for SampleState<N, D> where
DefaultAllocator: Allocator<N, D, D> + Allocator<N, U1, D> + Allocator<N, D>,
impl<N: Copy + FromPrimitive + RealField, D: Dim> KalmanEstimator<N, D> for SampleState<N, D> where
DefaultAllocator: Allocator<N, D, D> + Allocator<N, U1, D> + Allocator<N, D>,
Initialise the estimator with a KalmanState.
The estimator’s estimate of the system’s KalmanState.
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
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.