pub struct MixingRate {
pub correlation_decay: Vec<f64>,
pub decay_rate: f64,
pub mixing_timescale: f64,
}Expand description
Estimates the mixing rate of a dynamical system from the decay of its autocorrelation function.
An exponentially mixing system has autocorrelation C(k) ~ exp(-k/τ);
this struct fits that exponential to estimate the mixing time τ.
Fields§
§correlation_decay: Vec<f64>Autocorrelation values at successive lags (lag 0 = 1 by convention).
decay_rate: f64Estimated exponential decay rate γ such that C(k) ≈ exp(-γ k).
mixing_timescale: f64Estimated mixing time τ = 1/γ (in units of lag).
Implementations§
Source§impl MixingRate
impl MixingRate
Sourcepub fn from_autocorr(corr: Vec<f64>) -> Self
pub fn from_autocorr(corr: Vec<f64>) -> Self
Construct from a pre-computed autocorrelation sequence and estimate the exponential decay rate via log-linear regression.
Sourcepub fn mixing_time(&self, threshold: f64) -> Option<usize>
pub fn mixing_time(&self, threshold: f64) -> Option<usize>
Estimate the mixing time as the first lag at which the autocorrelation
drops below threshold.
Trait Implementations§
Source§impl Clone for MixingRate
impl Clone for MixingRate
Source§fn clone(&self) -> MixingRate
fn clone(&self) -> MixingRate
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 moreAuto Trait Implementations§
impl Freeze for MixingRate
impl RefUnwindSafe for MixingRate
impl Send for MixingRate
impl Sync for MixingRate
impl Unpin for MixingRate
impl UnsafeUnpin for MixingRate
impl UnwindSafe for MixingRate
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.