RollingValidRegBinary

Trait RollingValidRegBinary 

Source
pub trait RollingValidRegBinary<T: IsNone>: Vec1View<T> {
    // Provided methods
    fn ts_vregx_alpha_to<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>(
        &self,
        other: &V2,
        window: usize,
        min_periods: Option<usize>,
        out: Option<O::UninitRefMut<'_>>,
    ) -> Option<O>
       where T::Inner: Number,
             T2::Inner: Number,
             f64: Cast<U> { ... }
    fn ts_vregx_alpha<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>(
        &self,
        other: &V2,
        window: usize,
        min_periods: Option<usize>,
    ) -> O
       where T::Inner: Number,
             T2::Inner: Number,
             f64: Cast<U> { ... }
    fn ts_vregx_beta_to<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>(
        &self,
        other: &V2,
        window: usize,
        min_periods: Option<usize>,
        out: Option<O::UninitRefMut<'_>>,
    ) -> Option<O>
       where T::Inner: Number,
             T2::Inner: Number,
             f64: Cast<U> { ... }
    fn ts_vregx_beta<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>(
        &self,
        other: &V2,
        window: usize,
        min_periods: Option<usize>,
    ) -> O
       where T::Inner: Number,
             T2::Inner: Number,
             f64: Cast<U> { ... }
    fn ts_vregx_resid_mean_to<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>(
        &self,
        other: &V2,
        window: usize,
        min_periods: Option<usize>,
        out: Option<O::UninitRefMut<'_>>,
    ) -> Option<O>
       where T::Inner: Number,
             T2::Inner: Number,
             f64: Cast<U> { ... }
    fn ts_vregx_resid_mean<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>(
        &self,
        other: &V2,
        window: usize,
        min_periods: Option<usize>,
    ) -> O
       where T::Inner: Number,
             T2::Inner: Number,
             f64: Cast<U> { ... }
    fn ts_vregx_resid_std_to<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>(
        &self,
        other: &V2,
        window: usize,
        min_periods: Option<usize>,
        out: Option<O::UninitRefMut<'_>>,
    ) -> Option<O>
       where T::Inner: Number,
             T2::Inner: Number,
             f64: Cast<U> { ... }
    fn ts_vregx_resid_std<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>(
        &self,
        other: &V2,
        window: usize,
        min_periods: Option<usize>,
    ) -> O
       where T::Inner: Number,
             T2::Inner: Number,
             f64: Cast<U> { ... }
    fn ts_vregx_resid_skew_to<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>(
        &self,
        other: &V2,
        window: usize,
        min_periods: Option<usize>,
        out: Option<O::UninitRefMut<'_>>,
    ) -> Option<O>
       where T::Inner: Number,
             T2::Inner: Number,
             f64: Cast<U> { ... }
    fn ts_vregx_resid_skew<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>(
        &self,
        other: &V2,
        window: usize,
        min_periods: Option<usize>,
    ) -> O
       where T::Inner: Number,
             T2::Inner: Number,
             f64: Cast<U> { ... }
    fn ts_vregx_all<O: Vec1<(U, U, U)>, U, V2: Vec1View<T2>, T2: IsNone>(
        &self,
        other: &V2,
        window: usize,
        min_periods: Option<usize>,
    ) -> O
       where T::Inner: Number,
             T2::Inner: Number,
             f64: Cast<U> { ... }
}
Expand description

Trait for rolling window regression operations on valid (non-None) elements with two input vectors.

Provided Methods§

Source

fn ts_vregx_alpha_to<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>( &self, other: &V2, window: usize, min_periods: Option<usize>, out: Option<O::UninitRefMut<'_>>, ) -> Option<O>
where T::Inner: Number, T2::Inner: Number, f64: Cast<U>,

Calculates the rolling regression alpha (intercept) for valid elements within a window.

§Arguments
  • other - The second input vector for the regression.
  • 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 regression alpha values.

Source

fn ts_vregx_alpha<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>( &self, other: &V2, window: usize, min_periods: Option<usize>, ) -> O
where T::Inner: Number, T2::Inner: Number, f64: Cast<U>,

Calculates the rolling regression alpha (intercept) for valid elements within a window.

§Arguments
  • other - The second input vector for the regression.
  • 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 regression alpha values.

Source

fn ts_vregx_beta_to<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>( &self, other: &V2, window: usize, min_periods: Option<usize>, out: Option<O::UninitRefMut<'_>>, ) -> Option<O>
where T::Inner: Number, T2::Inner: Number, f64: Cast<U>,

Calculates the rolling regression beta (slope) for valid elements within a window.

§Arguments
  • other - The second input vector for the regression.
  • 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 regression beta values.

Source

fn ts_vregx_beta<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>( &self, other: &V2, window: usize, min_periods: Option<usize>, ) -> O
where T::Inner: Number, T2::Inner: Number, f64: Cast<U>,

Calculates the rolling regression beta (slope) for valid elements within a window.

§Arguments
  • other - The second input vector for the regression.
  • 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 regression beta values.

Source

fn ts_vregx_resid_mean_to<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>( &self, other: &V2, window: usize, min_periods: Option<usize>, out: Option<O::UninitRefMut<'_>>, ) -> Option<O>
where T::Inner: Number, T2::Inner: Number, f64: Cast<U>,

Calculates the rolling mean of regression residuals for valid elements within a window.

§Arguments
  • other - The second input vector for the regression.
  • 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 mean of regression residuals.

Source

fn ts_vregx_resid_mean<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>( &self, other: &V2, window: usize, min_periods: Option<usize>, ) -> O
where T::Inner: Number, T2::Inner: Number, f64: Cast<U>,

Calculates the rolling mean of regression residuals for valid elements within a window.

§Arguments
  • other - The second input vector for the regression.
  • 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 mean of regression residuals.

Source

fn ts_vregx_resid_std_to<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>( &self, other: &V2, window: usize, min_periods: Option<usize>, out: Option<O::UninitRefMut<'_>>, ) -> Option<O>
where T::Inner: Number, T2::Inner: Number, f64: Cast<U>,

Calculates the rolling standard deviation of regression residuals for valid elements within a window.

§Arguments
  • other - The second input vector for the regression.
  • 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 standard deviation of regression residuals.

Source

fn ts_vregx_resid_std<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>( &self, other: &V2, window: usize, min_periods: Option<usize>, ) -> O
where T::Inner: Number, T2::Inner: Number, f64: Cast<U>,

Calculates the rolling standard deviation of regression residuals for valid elements within a window.

§Arguments
  • other - The second input vector for the regression.
  • 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 standard deviation of regression residuals.

Source

fn ts_vregx_resid_skew_to<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>( &self, other: &V2, window: usize, min_periods: Option<usize>, out: Option<O::UninitRefMut<'_>>, ) -> Option<O>
where T::Inner: Number, T2::Inner: Number, f64: Cast<U>,

Calculates the rolling skewness of regression residuals for valid elements within a window.

§Arguments
  • other - The second input vector for the regression.
  • 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 skewness of regression residuals.

Source

fn ts_vregx_resid_skew<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>( &self, other: &V2, window: usize, min_periods: Option<usize>, ) -> O
where T::Inner: Number, T2::Inner: Number, f64: Cast<U>,

Calculates the rolling skewness of regression residuals for valid elements within a window.

§Arguments
  • other - The second input vector for the regression.
  • 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 skewness of regression residuals.

Source

fn ts_vregx_all<O: Vec1<(U, U, U)>, U, V2: Vec1View<T2>, T2: IsNone>( &self, other: &V2, window: usize, min_periods: Option<usize>, ) -> O
where T::Inner: Number, T2::Inner: Number, f64: Cast<U>,

Calculates rolling regression statistics for two vectors.

This function computes rolling regression statistics (alpha, beta, and sum of squared errors) for two input vectors over a specified window size.

§Arguments
  • other - The second input vector for regression.
  • window - The size of the rolling window.
  • min_periods - The minimum number of observations required to have a value; defaults to window / 2.
§Type Parameters
  • O - The output vector type, must implement Vec1<(U, U, U)>.
  • U - The type of the output elements.
  • V2 - The type of the second input vector, must implement Vec1View<T2>.
  • T2 - The element type of the second input vector, must implement IsNone.
§Returns

Returns a vector of tuples (alpha, beta, sse) where:

  • alpha is the y-intercept of the regression line.
  • beta is the slope of the regression line.
  • sse is the sum of squared errors.
§Notes
  • The function uses a rolling window approach to calculate regression statistics.
  • NaN values are returned for windows with insufficient observations.
  • The calculation assumes that T::Inner and T2::Inner implement Number.
  • The output type U must be able to be cast from f64.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§