pub struct BayesianUpdater { /* private fields */ }Expand description
Bayesian state updater for a single axis.
Maintains posterior distribution (mean, variance) and updates with each observation using standard Bayesian updating.
Implementations§
Source§impl BayesianUpdater
impl BayesianUpdater
Sourcepub fn with_config(config: BayesianConfig) -> Self
pub fn with_config(config: BayesianConfig) -> Self
Create an updater with custom configuration.
Sourcepub fn update(
&self,
axis: &str,
prior: &Prior,
observation: &Observation,
) -> AxisEstimate
pub fn update( &self, axis: &str, prior: &Prior, observation: &Observation, ) -> AxisEstimate
Perform a Bayesian update given prior and observation.
Returns the posterior distribution as an AxisEstimate.
Sourcepub fn update_estimate(
&self,
existing: &AxisEstimate,
observation: &Observation,
) -> AxisEstimate
pub fn update_estimate( &self, existing: &AxisEstimate, observation: &Observation, ) -> AxisEstimate
Update an existing estimate with a new observation.
The existing estimate serves as the prior.
Sourcepub fn grow_uncertainty(
&self,
estimate: &AxisEstimate,
elapsed_seconds: f64,
) -> AxisEstimate
pub fn grow_uncertainty( &self, estimate: &AxisEstimate, elapsed_seconds: f64, ) -> AxisEstimate
Grow uncertainty over time without observations.
Variance increases linearly, representing growing uncertainty about stale estimates.
Sourcepub fn combine_observations(
&self,
axis: &str,
prior: &Prior,
observations: &[Observation],
) -> AxisEstimate
pub fn combine_observations( &self, axis: &str, prior: &Prior, observations: &[Observation], ) -> AxisEstimate
Combine multiple observations into a single posterior.
Useful when multiple signals about the same axis arrive at once.
Trait Implementations§
Source§impl Clone for BayesianUpdater
impl Clone for BayesianUpdater
Source§fn clone(&self) -> BayesianUpdater
fn clone(&self) -> BayesianUpdater
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BayesianUpdater
impl Debug for BayesianUpdater
Source§impl Default for BayesianUpdater
impl Default for BayesianUpdater
Source§fn default() -> BayesianUpdater
fn default() -> BayesianUpdater
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for BayesianUpdater
impl RefUnwindSafe for BayesianUpdater
impl Send for BayesianUpdater
impl Sync for BayesianUpdater
impl Unpin for BayesianUpdater
impl UnsafeUnpin for BayesianUpdater
impl UnwindSafe for BayesianUpdater
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more