pub struct RegimeAnalytics;Expand description
Core analytical tools for analyzing regime sequences.
Implementations§
Source§impl RegimeAnalytics
impl RegimeAnalytics
Sourcepub fn transition_matrix(states: &[u32], num_states: usize) -> Vec<Vec<f64>>
pub fn transition_matrix(states: &[u32], num_states: usize) -> Vec<Vec<f64>>
Constructs an empirical transition matrix from a sequence of regime states.
The matrix T[i][j] represents the probability of transitioning from state i to state j.
Sourcepub fn forecast_state(
transition_matrix: &[Vec<f64>],
current_state: u32,
steps: usize,
) -> Vec<f64>
pub fn forecast_state( transition_matrix: &[Vec<f64>], current_state: u32, steps: usize, ) -> Vec<f64>
Forecasts the state probability distribution n steps ahead.
Uses matrix exponentiation (powering) of the transition matrix.
Sourcepub fn duration_stats(states: &[u32], num_states: usize) -> Vec<DurationStats>
pub fn duration_stats(states: &[u32], num_states: usize) -> Vec<DurationStats>
Calculates duration statistics for each regime in the sequence.
Sourcepub fn stability_score(states: &[u32]) -> f64
pub fn stability_score(states: &[u32]) -> f64
Calculates a stability score (0.0 to 1.0).
Higher scores indicate fewer regime switches relative to the total sequence length.
Auto Trait Implementations§
impl Freeze for RegimeAnalytics
impl RefUnwindSafe for RegimeAnalytics
impl Send for RegimeAnalytics
impl Sync for RegimeAnalytics
impl Unpin for RegimeAnalytics
impl UnsafeUnpin for RegimeAnalytics
impl UnwindSafe for RegimeAnalytics
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<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.