clip_nb
| Name | Type | Default | Description |
|---|---|---|---|
number | float | -- | The number to clip. |
upper | float | -- | The upper bound. |
lower | float | -- | The lower bound. |
| Type | Description |
|---|---|
float | The clipped number. |
get_log_nb
| Name | Type | Default | Description |
|---|---|---|---|
number | float | -- | The input number. |
epsilon | float | 1e-10 | A small positive constant to avoid log(0), default is 1e-10. |
| Type | Description |
|---|---|
float | The logarithm of the number or a fallback small value. |
get_log_diff_nb
| Name | Type | Default | Description |
|---|---|---|---|
arr | tp.Array2d | -- | 2-dimensional array. |
| Type | Description |
|---|---|
tp.Array1d | Arrays of log difference. |
get_diff_nb
| Name | Type | Default | Description |
|---|---|---|---|
arr | tp.Array2d | -- | 2-dimensional array. |
| Type | Description |
|---|---|
tp.Array1d | Arrays of log difference. |
zscore_nb
| Name | Type | Default | Description |
|---|---|---|---|
arr | tp.Array1d | -- | A 2D NumPy array. |
ddof | int | 1 | Delta degrees of freedom for standard deviation calculation, default is 1. |
| Type | Description |
|---|---|
float | The z-score of the last element. |
get_rolling_zscore_nb
| Name | Type | Default | Description |
|---|---|---|---|
arr | tp.Array2d | -- | A 2D NumPy array. |
window | int | -- | The rolling window size. |
minp | int | -- | Minimum number of observations required. |
ddof | int | 1 | Delta degrees of freedom for standard deviation calculation, default is 1. |
| Type | Description |
|---|---|
tp.Array2d | A 2D array of rolling z-scores. |
get_rolling_mean_1d_nb
rolling_mean_acc_nb at each iteration.
Numba equivalent to pd.Series(arr).rolling(window, min_periods=minp).mean().
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
arr | tp.Array1d | -- | One-dimensional array of numeric data. |
window | int | -- | Window size. |
minp | int | -- | Minimum number of observations required. |
| Type | Description |
|---|---|
tp.Array1d | Array containing the rolling means. |
get_rolling_sum_1d_nb
rolling_sum_acc_nb to update the accumulation state for each iteration,
emulating the behavior of pd.Series(arr).rolling(window, min_periods=minp).sum().
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
arr | tp.Array1d | -- | One-dimensional array of numeric data. |
window | int | -- | Window size. |
minp | int | -- | Minimum number of observations required. |
| Type | Description |
|---|---|
tp.Array1d | Array containing the rolling sums. |
get_rolling_ols_zscore_nb
| Name | Type | Default | Description |
|---|---|---|---|
arr | tp.Array2d | -- | 2-dimensional array. |
window | FlexArray1dLike | -- | Window size. Provided as a scalar or per column. |
norm_window | FlexArray1dLike | -- | Window size for error normalization. Provided as a scalar or per column. Defaults to window if None. |
minp | int | -- | Minimum number of observations required. |
ddof | int | -- | Delta degrees of freedom. |
| Type | Description |
|---|---|
tp.Array1d | Arrays of z-scores for each column. |
get_rolling_ols_pred_nb
| Name | Type | Default | Description |
|---|---|---|---|
arr | tp.Array2d | -- | 2-dimensional array. |
window | FlexArray1dLike | -- | Window size. Provided as a scalar or per column. |
norm_window | FlexArray1dLike | -- | Window size for error normalization. Provided as a scalar or per column. Defaults to window if None. |
minp | int | -- | Minimum number of observations required. |
ddof | int | -- | Delta degrees of freedom. |
| Type | Description |
|---|---|
tp.Array1d | Arrays of z-scores for each column. |
get_rolling_ols_residual_nb
| Name | Type | Default | Description |
|---|---|---|---|
arr | tp.Array2d | -- | 2-dimensional array. |
window | FlexArray1dLike | -- | Window size. Provided as a scalar or per column. |
norm_window | FlexArray1dLike | -- | Window size for error normalization. Provided as a scalar or per column. Defaults to window if None. |
minp | int | -- | Minimum number of observations required. |
ddof | int | -- | Delta degrees of freedom. |
| Type | Description |
|---|---|
tp.Array1d | Arrays of z-scores for each column. |
get_rolling_deviation_nb
| Name | Type | Default | Description |
|---|---|---|---|
arr | tp.Array1d | -- | A 2D NumPy array. |
| Type | Description |
|---|---|
float | The computed rolling deviation. |
get_rolling_std_nb
| Name | Type | Default | Description |
|---|---|---|---|
arr | tp.Array2d | -- | A 2D NumPy array. |
window | int | -- | The rolling window size. |
ddof | int | 1 | Delta degrees of freedom for standard deviation calculation, default is 1. |
| Type | Description |
|---|---|
tp.Array2d | A 2D array of rolling standard deviations. |
get_ecdf
| Name | Type | Default | Description |
|---|---|---|---|
arr | tp.Array1d | -- | A 1D NumPy array of data points. |
| Type | Description |
|---|---|
_ECDF | An _ECDF object. |
get_weighted_average_nb
| Name | Type | Default | Description |
|---|---|---|---|
scores | tp.Array | -- | A NumPy array of scores. |
weights | tp.Array | -- | A NumPy array of corresponding weights. |
axis | int | -- | The axis along which to compute the weighted average (0 = columns, 1 = rows). |
| Type | Description |
|---|---|
ValueError | If the axis is not 0 or 1. |
| Type | Description |
|---|---|
tp.Array | The computed weighted average along the specified axis. |
get_cumulative_index_nb
| Name | Type | Default | Description |
|---|---|---|---|
model_output | tp.Array2d | -- | The array of predictions to calculate the cumulative index. |
center | float | 0.5 | The center value to subtract from each prediction. Default is 0.5. |
| Type | Description |
|---|---|
tp.Array2d | The cumulative index as an array. |
get_reset_index_nb
| Name | Type | Default | Description |
|---|---|---|---|
model_output | tp.Array2d | -- | The array of predictions to calculate the reset index. |
lower | float | -1.0 | The lower bound for resetting the accumulated sum. Default is -1.0. |
upper | float | 1.0 | The upper bound for resetting the accumulated sum. Default is 1.0. |
center | float | 0.5 | The center value to subtract from each prediction. Default is 0.5. |
| Type | Description |
|---|---|
tp.Array2d | The reset index as an array. |
get_clip_index_nb
mask parameter is a 1D array selecting valid values across all columns.
If mask value is True, values are replaced with previous valid values.
Otherwise, accumulated sum of predictions. If None, no masking is applied.
if bound_reversion is set to True, it compute the cumulative sum of negative (positive)
values toward the center, ignoring mask, uppon reaching the upper or lower bound respectively.
This technique increases the speed of reversion toward neutrality. Defaults to False.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
model_output | tp.Array2d | -- | The array of predictions to calculate the clipped index. The third column is a mask to select valid values. If mask value is True, values are replaced with previous valid values. Otherwise, accumulated sum of predictions. |
mask | tp.Array1d | None | Mask array (1D) to select valid values. If True, replace with previous valid value. Defaults to None. |
lower | float | -1.0 | The lower bound for clipping the accumulated sum. Default is -1.0. |
upper | float | 1.0 | The upper bound for clipping the accumulated sum. Default is 1.0. |
center | float | 0.5 | The center value to subtract from each prediction. Default is 0.5. |
bound_reversion | bool | False | if speed_reversion is set to True, it compute the cumulative sum of negative (positive) values toward the center, ignoring mask, uppon reaching the upper or lower bound respectively. This technique increases the speed of reversion toward neutrality. Defaults to False. |
| Type | Description |
|---|---|
tp.Array2d | The clipped index as an array. |
| Type | Description |
|---|---|
ValueError | If mask is not None and its length does not match the number of rows in model_output. |
get_scaled_zscore
| Name | Type | Default | Description |
|---|---|---|---|
zscore | tp.Array | -- | Z-score values. |
| Type | Description |
|---|---|
tp.Array | tp.SeriesFrame | Uniform. |
get_ellipse
| Name | Type | Default | Description |
|---|---|---|---|
arr | tp.Array2d | -- | Input data of shape (n_samples, 2) representing the 2D points. |
std | float | 2.0 | Standard deviation threshold defining the size of the ellipse (e.g., 2 for ~95% confidence). |
| Type | Description |
|---|---|
tp.Array2 | Ellipse. |

