Struct bayes_estimate::estimators::sir::SampleState [−][src]
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]
DefaultAllocator: Allocator<N, D, D> + Allocator<N, D>,
pub fn new_equal_likelihood(
s: Vec<VectorN<N, D>>,
rng: Box<dyn RngCore>
) -> SampleState<N, D>
[src]
s: Vec<VectorN<N, D>>,
rng: Box<dyn RngCore>
) -> SampleState<N, D>
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]
&mut self,
f: impl Fn(&VectorN<N, D>, &mut dyn RngCore) -> VectorN<N, D>
)
pub fn observe<LikelihoodFn>(&mut self, l: LikelihoodFn) where
LikelihoodFn: Fn(&VectorN<N, D>) -> f32,
[src]
LikelihoodFn: Fn(&VectorN<N, D>) -> f32,
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]
&mut self,
resampler: &mut Resampler,
roughener: &mut Roughener<N, D>
) -> Result<(u32, f32), &'static str>
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]
DefaultAllocator: Allocator<N, D>,
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]
DefaultAllocator: Allocator<N, D, D> + Allocator<N, U1, D> + Allocator<N, D>,
fn init(&mut self, state: &KalmanState<N, D>) -> Result<(), &'static str>
[src]
fn kalman_state(&self) -> Result<KalmanState<N, D>, &'static str>
[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn is_in_subset(&self) -> bool
pub fn to_subset_unchecked(&self) -> SS
pub fn from_subset(element: &SS) -> SP
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,