fynance.features.scale.roll_standardize¶
-
fynance.features.scale.
roll_standardize
(X, w=None, a=0, b=1, axis=0, kind_moment='s')¶ Substitutes the rolling mean and divid by the rolling standard dev.
\[RollStandardize(X)^w_t = b \times \frac{X_t - RollMean(X)^w_t} {RollStd(X)^w_t} + a\]Parameters: - X : np.ndarray[dtype, ndim=1 or 2]
Data to scale.
- w : int, optional
Size of the lagged window of the moving average/standard deviation, must be positive. If
w is None
orw=0
, thenw=X.shape[axis]
. Default is None.- a, b : float or array_like, optional
Respectively an additional and multiply factor.
- axis : int, optional
Axis along which to scale the data.
- kind_moment : str {“s”, “w”, “e”}, optional
Returns: - np.ndarray[dtype, ndim=1 or 2]
The scaled data.
See also