Trait tea_rolling::RollingValidNorm

source ·
pub trait RollingValidNorm<T: IsNone>: Vec1View<T> {
    // Provided methods
    fn ts_vzscore_to<O: Vec1<U>, U>(
        &self,
        window: usize,
        min_periods: Option<usize>,
        out: Option<O::UninitRefMut<'_>>,
    ) -> Option<O>
       where T::Inner: Number,
             f64: Cast<U> { ... }
    fn ts_vzscore<O: Vec1<U>, U>(
        &self,
        window: usize,
        min_periods: Option<usize>,
    ) -> O
       where T::Inner: Number,
             f64: Cast<U> { ... }
    fn ts_vminmaxnorm_to<O: Vec1<U>, U>(
        &self,
        window: usize,
        min_periods: Option<usize>,
        out: Option<O::UninitRefMut<'_>>,
    ) -> Option<O>
       where T::Inner: Number,
             f64: Cast<U> { ... }
    fn ts_vminmaxnorm<O: Vec1<U>, U>(
        &self,
        window: usize,
        min_periods: Option<usize>,
    ) -> O
       where T::Inner: Number,
             f64: Cast<U> { ... }
}
Expand description

Trait for rolling window normalization operations on valid (non-None) elements.

Provided Methods§

source

fn ts_vzscore_to<O: Vec1<U>, U>( &self, window: usize, min_periods: Option<usize>, out: Option<O::UninitRefMut<'_>>, ) -> Option<O>
where T::Inner: Number, f64: Cast<U>,

Calculates the rolling z-score (standard score) for valid elements within a window.

§Arguments
  • window - The size of the rolling window.
  • min_periods - The minimum number of observations in window required to have a value.
  • out - Optional output buffer to store the results.
§Returns

A vector containing the rolling z-scores.

§Notes

The z-score is calculated as (x - mean) / standard_deviation. If the standard deviation is zero or if there are fewer than min_periods valid observations, the result will be NaN.

source

fn ts_vzscore<O: Vec1<U>, U>( &self, window: usize, min_periods: Option<usize>, ) -> O
where T::Inner: Number, f64: Cast<U>,

Calculates the rolling z-score (standard score) for valid elements within a window.

§Arguments
  • window - The size of the rolling window.
  • min_periods - The minimum number of observations in window required to have a value.
  • out - Optional output buffer to store the results.
§Returns

A vector containing the rolling z-scores.

§Notes

The z-score is calculated as (x - mean) / standard_deviation. If the standard deviation is zero or if there are fewer than min_periods valid observations, the result will be NaN.

source

fn ts_vminmaxnorm_to<O: Vec1<U>, U>( &self, window: usize, min_periods: Option<usize>, out: Option<O::UninitRefMut<'_>>, ) -> Option<O>
where T::Inner: Number, f64: Cast<U>,

Calculates the rolling min-max normalization for valid elements within a window.

§Arguments
  • window - The size of the rolling window.
  • min_periods - The minimum number of observations in window required to have a value.
  • out - Optional output buffer to store the results.
§Returns

A vector containing the rolling min-max normalized values.

§Notes

The min-max normalization is calculated as (x - min) / (max - min). If max equals min or if there are fewer than min_periods valid observations, the result will be NaN.

source

fn ts_vminmaxnorm<O: Vec1<U>, U>( &self, window: usize, min_periods: Option<usize>, ) -> O
where T::Inner: Number, f64: Cast<U>,

Calculates the rolling min-max normalization for valid elements within a window.

§Arguments
  • window - The size of the rolling window.
  • min_periods - The minimum number of observations in window required to have a value.
  • out - Optional output buffer to store the results.
§Returns

A vector containing the rolling min-max normalized values.

§Notes

The min-max normalization is calculated as (x - min) / (max - min). If max equals min or if there are fewer than min_periods valid observations, the result will be NaN.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T: IsNone, I: Vec1View<T>> RollingValidNorm<T> for I