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§
Sourcefn 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>
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>
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.
Sourcefn ts_vregx_alpha<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>(
&self,
other: &V2,
window: usize,
min_periods: Option<usize>,
) -> O
fn ts_vregx_alpha<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>( &self, other: &V2, window: usize, min_periods: Option<usize>, ) -> O
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.
Sourcefn 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>
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>
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.
Sourcefn ts_vregx_beta<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>(
&self,
other: &V2,
window: usize,
min_periods: Option<usize>,
) -> O
fn ts_vregx_beta<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>( &self, other: &V2, window: usize, min_periods: Option<usize>, ) -> O
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.
Sourcefn 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>
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>
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.
Sourcefn ts_vregx_resid_mean<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>(
&self,
other: &V2,
window: usize,
min_periods: Option<usize>,
) -> O
fn ts_vregx_resid_mean<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>( &self, other: &V2, window: usize, min_periods: Option<usize>, ) -> O
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.
Sourcefn 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>
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>
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.
Sourcefn ts_vregx_resid_std<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>(
&self,
other: &V2,
window: usize,
min_periods: Option<usize>,
) -> O
fn ts_vregx_resid_std<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>( &self, other: &V2, window: usize, min_periods: Option<usize>, ) -> O
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.
Sourcefn 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>
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>
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.
Sourcefn ts_vregx_resid_skew<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>(
&self,
other: &V2,
window: usize,
min_periods: Option<usize>,
) -> O
fn ts_vregx_resid_skew<O: Vec1<U>, U, V2: Vec1View<T2>, T2: IsNone>( &self, other: &V2, window: usize, min_periods: Option<usize>, ) -> O
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.
Sourcefn ts_vregx_all<O: Vec1<(U, U, U)>, U, V2: Vec1View<T2>, T2: IsNone>(
&self,
other: &V2,
window: usize,
min_periods: Option<usize>,
) -> O
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
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 towindow / 2.
§Type Parameters
O- The output vector type, must implementVec1<(U, U, U)>.U- The type of the output elements.V2- The type of the second input vector, must implementVec1View<T2>.T2- The element type of the second input vector, must implementIsNone.
§Returns
Returns a vector of tuples (alpha, beta, sse) where:
alphais the y-intercept of the regression line.betais the slope of the regression line.sseis 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::InnerandT2::InnerimplementNumber. - The output type
Umust be able to be cast fromf64.
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.