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§
sourcefn ts_vzscore_to<O: Vec1<U>, U>(
&self,
window: usize,
min_periods: Option<usize>,
out: Option<O::UninitRefMut<'_>>,
) -> Option<O>
fn ts_vzscore_to<O: Vec1<U>, U>( &self, window: usize, min_periods: Option<usize>, out: Option<O::UninitRefMut<'_>>, ) -> Option<O>
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.
sourcefn ts_vzscore<O: Vec1<U>, U>(
&self,
window: usize,
min_periods: Option<usize>,
) -> O
fn ts_vzscore<O: Vec1<U>, U>( &self, window: usize, min_periods: Option<usize>, ) -> O
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.
sourcefn ts_vminmaxnorm_to<O: Vec1<U>, U>(
&self,
window: usize,
min_periods: Option<usize>,
out: Option<O::UninitRefMut<'_>>,
) -> Option<O>
fn ts_vminmaxnorm_to<O: Vec1<U>, U>( &self, window: usize, min_periods: Option<usize>, out: Option<O::UninitRefMut<'_>>, ) -> Option<O>
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.
sourcefn ts_vminmaxnorm<O: Vec1<U>, U>(
&self,
window: usize,
min_periods: Option<usize>,
) -> O
fn ts_vminmaxnorm<O: Vec1<U>, U>( &self, window: usize, min_periods: Option<usize>, ) -> O
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.