Skip to main content

AggValidFinal

Trait AggValidFinal 

Source
pub trait AggValidFinal<T: IsNone>: Vec1View<T> {
    // Provided methods
    fn vcorr<V2: Vec1View<T>>(
        &self,
        other: &V2,
        min_periods: Option<usize>,
        method: CorrMethod,
    ) -> T::Cast<f64>
       where T::Inner: Zero + Number,
             T: PartialEq + PartialOrd,
             f64: Cast<T::Cast<f64>>,
             Self: MapValidVec<T> { ... }
    fn half_life(&self, min_periods: Option<usize>) -> usize
       where T: Clone,
             T::Inner: Number { ... }
}
Expand description

Trait for aggregation operations on vectors with valid (non-None) elements.

Provided Methods§

Source

fn vcorr<V2: Vec1View<T>>( &self, other: &V2, min_periods: Option<usize>, method: CorrMethod, ) -> T::Cast<f64>
where T::Inner: Zero + Number, T: PartialEq + PartialOrd, f64: Cast<T::Cast<f64>>, Self: MapValidVec<T>,

Calculates the correlation between two vectors using the specified method.

§Arguments
  • other - The other vector to correlate with.
  • min_periods - The minimum number of valid pairs required to compute the correlation.
  • method - The correlation method to use (Pearson or Spearman).
§Returns

The correlation coefficient as a floating-point number.

Source

fn half_life(&self, min_periods: Option<usize>) -> usize
where T: Clone, T::Inner: Number,

Calculates the half-life of the autocorrelation of the vector.

The half-life is defined as the lag at which the autocorrelation drops to 0.5.

§Arguments
  • min_periods - The minimum number of valid pairs required to compute correlations.
§Returns

The half-life as a usize.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<V: Vec1View<T>, T: IsNone> AggValidFinal<T> for V