rolling module¶
Generic Numba-compiled functions for rolling and expanding windows.
alpha_from_com_nb function¶
Get the smoothing factor alpha from a center of mass.
alpha_from_halflife_nb function¶
Get the smoothing factor alpha from a half-life.
alpha_from_span_nb function¶
Get the smoothing factor alpha from a span.
alpha_from_wilder_nb function¶
Get the smoothing factor alpha from a Wilder's period.
ewm_mean_1d_nb function¶
Compute exponential weighted moving average.
Uses ewm_mean_acc_nb() at each iteration.
Numba equivalent to pd.Series(arr).ewm(span=span, min_periods=minp, adjust=adjust).mean().
Adaptation of pd._libs.window.aggregations.window_aggregations.ewma with default arguments.
Note
In contrast to the Pandas implementation, minp is effective within span.
ewm_mean_acc_nb function¶
Accumulator of ewm_mean_1d_nb().
Takes a state of type EWMMeanAIS and returns a state of type EWMMeanAOS.
ewm_mean_nb function¶
2-dim version of ewm_mean_1d_nb().
ewm_std_1d_nb function¶
Compute exponential weighted moving standard deviation.
Uses ewm_std_acc_nb() at each iteration.
Numba equivalent to pd.Series(arr).ewm(span=span, min_periods=minp).std().
Adaptation of pd._libs.window.aggregations.window_aggregations.ewmcov with default arguments.
Note
In contrast to the Pandas implementation, minp is effective within span.
ewm_std_acc_nb function¶
Accumulator of ewm_std_1d_nb().
Takes a state of type EWMStdAIS and returns a state of type EWMStdAOS.
ewm_std_nb function¶
2-dim version of ewm_std_1d_nb().
expanding_max_1d_nb function¶
Compute expanding max.
Numba equivalent to pd.Series(arr).expanding(min_periods=minp).max().
expanding_max_nb function¶
2-dim version of expanding_max_1d_nb().
expanding_min_1d_nb function¶
Compute expanding min.
Numba equivalent to pd.Series(arr).expanding(min_periods=minp).min().
expanding_min_nb function¶
2-dim version of expanding_min_1d_nb().
ma_1d_nb function¶
Compute a moving average based on the mode of the type WType.
ma_nb function¶
2-dim version of ma_1d_nb().
msd_1d_nb function¶
Compute a moving standard deviation based on the mode of the type WType.
msd_nb function¶
2-dim version of msd_1d_nb().
rolling_all_1d_nb function¶
Compute rolling all.
rolling_all_nb function¶
2-dim version of rolling_all_1d_nb().
rolling_any_1d_nb function¶
Compute rolling any.
rolling_any_nb function¶
2-dim version of rolling_any_1d_nb().
rolling_argmax_1d_nb function¶
Compute rolling max index.
rolling_argmax_nb function¶
2-dim version of rolling_argmax_1d_nb().
rolling_argmin_1d_nb function¶
Compute rolling min index.
rolling_argmin_nb function¶
2-dim version of rolling_argmin_1d_nb().
rolling_corr_1d_nb function¶
Compute rolling correlation coefficient.
Numba equivalent to pd.Series(arr1).rolling(window, min_periods=minp).corr(arr2).
rolling_corr_acc_nb function¶
Accumulator of rolling_corr_1d_nb().
Takes a state of type RollCorrAIS and returns a state of type RollCorrAOS.
rolling_corr_nb function¶
2-dim version of rolling_corr_1d_nb().
rolling_cov_1d_nb function¶
Compute rolling covariance.
Numba equivalent to pd.Series(arr1).rolling(window, min_periods=minp).cov(arr2).
rolling_cov_acc_nb function¶
Accumulator of rolling_cov_1d_nb().
Takes a state of type RollCovAIS and returns a state of type RollCovAOS.
rolling_cov_nb function¶
2-dim version of rolling_cov_1d_nb().
rolling_max_1d_nb function¶
Compute rolling max.
Numba equivalent to pd.Series(arr).rolling(window, min_periods=minp).max().
rolling_max_nb function¶
2-dim version of rolling_max_1d_nb().
rolling_mean_1d_nb function¶
Compute rolling mean.
Uses rolling_mean_acc_nb() at each iteration.
Numba equivalent to pd.Series(arr).rolling(window, min_periods=minp).mean().
rolling_mean_acc_nb function¶
Accumulator of rolling_mean_1d_nb().
Takes a state of type RollMeanAIS and returns a state of type RollMeanAOS.
rolling_mean_nb function¶
2-dim version of rolling_mean_1d_nb().
rolling_min_1d_nb function¶
Compute rolling min.
Numba equivalent to pd.Series(arr).rolling(window, min_periods=minp).min().
rolling_min_nb function¶
2-dim version of rolling_min_1d_nb().
rolling_ols_1d_nb function¶
Compute rolling linear regression.
rolling_ols_acc_nb function¶
Accumulator of rolling_ols_1d_nb().
Takes a state of type RollOLSAIS and returns a state of type RollOLSAOS.
rolling_ols_nb function¶
2-dim version of rolling_ols_1d_nb().
rolling_pattern_similarity_1d_nb function¶
rolling_pattern_similarity_1d_nb(
arr,
pattern,
window=None,
max_window=None,
row_select_prob=1.0,
window_select_prob=1.0,
interp_mode=3,
rescale_mode=0,
vmin=nan,
vmax=nan,
pmin=nan,
pmax=nan,
invert=False,
error_type=0,
distance_measure=0,
max_error=nan,
max_error_interp_mode=None,
max_error_as_maxdist=False,
max_error_strict=False,
min_pct_change=nan,
max_pct_change=nan,
min_similarity=0.85,
minp=None
)
Compute rolling pattern similarity.
Uses pattern_similarity_nb().
rolling_pattern_similarity_nb function¶
rolling_pattern_similarity_nb(
arr,
pattern,
window=None,
max_window=None,
row_select_prob=1.0,
window_select_prob=1.0,
interp_mode=3,
rescale_mode=0,
vmin=nan,
vmax=nan,
pmin=nan,
pmax=nan,
invert=False,
error_type=0,
distance_measure=0,
max_error=nan,
max_error_interp_mode=None,
max_error_as_maxdist=False,
max_error_strict=False,
min_pct_change=nan,
max_pct_change=nan,
min_similarity=0.85,
minp=None
)
2-dim version of rolling_pattern_similarity_1d_nb().
rolling_prod_1d_nb function¶
Compute rolling product.
Uses rolling_prod_acc_nb() at each iteration.
Numba equivalent to pd.Series(arr).rolling(window, min_periods=minp).apply(np.prod).
rolling_prod_acc_nb function¶
Accumulator of rolling_prod_1d_nb().
Takes a state of type RollProdAIS and returns a state of type RollProdAOS.
rolling_prod_nb function¶
2-dim version of rolling_prod_1d_nb().
rolling_rank_1d_nb function¶
Rolling version of rank_1d_nb.
rolling_rank_nb function¶
2-dim version of rolling_rank_1d_nb().
rolling_std_1d_nb function¶
Compute rolling standard deviation.
Uses rolling_std_acc_nb() at each iteration.
Numba equivalent to pd.Series(arr).rolling(window, min_periods=minp).std(ddof=ddof).
rolling_std_acc_nb function¶
Accumulator of rolling_std_1d_nb().
Takes a state of type RollStdAIS and returns a state of type RollStdAOS.
rolling_std_nb function¶
2-dim version of rolling_std_1d_nb().
rolling_sum_1d_nb function¶
Compute rolling sum.
Uses rolling_sum_acc_nb() at each iteration.
Numba equivalent to pd.Series(arr).rolling(window, min_periods=minp).sum().
rolling_sum_acc_nb function¶
Accumulator of rolling_sum_1d_nb().
Takes a state of type RollSumAIS and returns a state of type RollSumAOS.
rolling_sum_nb function¶
2-dim version of rolling_sum_1d_nb().
rolling_zscore_1d_nb function¶
Compute rolling z-score.
Uses rolling_zscore_acc_nb() at each iteration.
rolling_zscore_acc_nb function¶
Accumulator of rolling_zscore_1d_nb().
Takes a state of type RollZScoreAIS and returns a state of type RollZScoreAOS.
rolling_zscore_nb function¶
2-dim version of rolling_zscore_1d_nb().
vidya_1d_nb function¶
Compute VIDYA.
Uses vidya_acc_nb() at each iteration.
vidya_acc_nb function¶
Accumulator of vidya_1d_nb().
Takes a state of type VidyaAIS and returns a state of type VidyaAOS.
vidya_nb function¶
2-dim version of vidya_1d_nb().
wm_mean_1d_nb function¶
Compute weighted moving average.
Uses wm_mean_acc_nb() at each iteration.
wm_mean_acc_nb function¶
Accumulator of wm_mean_1d_nb().
Takes a state of type WMMeanAIS and returns a state of type WMMeanAOS.
wm_mean_nb function¶
2-dim version of wm_mean_1d_nb().
wwm_mean_1d_nb function¶
Compute Wilder's exponential weighted moving average.
wwm_mean_nb function¶
2-dim version of wwm_mean_1d_nb().
wwm_std_1d_nb function¶
Compute Wilder's exponential weighted moving standard deviation.
wwm_std_nb function¶
2-dim version of wwm_std_1d_nb().