# polars.Series.ewm_std#

Series.ewm_std(com: = None, span: = None, half_life: = None, alpha: = None, adjust: bool = True, bias: bool = False, min_periods: int = 1) [source]#

Exponentially-weighted moving standard deviation.

Parameters:
com

Specify decay in terms of center of mass, $$\gamma$$, with

$\alpha = \frac{1}{1 + \gamma} \; \forall \; \gamma \geq 0$
span

Specify decay in terms of span, $$\theta$$, with

$\alpha = \frac{2}{\theta + 1} \; \forall \; \theta \geq 1$
half_life

Specify decay in terms of half-life, $$\lambda$$, with

$\alpha = 1 - \exp \left\{ \frac{ -\ln(2) }{ \lambda } \right\} \; \forall \; \lambda > 0$
alpha

Specify smoothing factor alpha directly, $$0 < \alpha \leq 1$$.

Divide by decaying adjustment factor in beginning periods to account for imbalance in relative weightings

• When adjust=True the EW function is calculated using weights $$w_i = (1 - \alpha)^i$$

• When adjust=False the EW function is calculated recursively by

$\begin{split}y_0 &= x_0 \\ y_t &= (1 - \alpha)y_{t - 1} + \alpha x_t\end{split}$
bias

When bias=False, apply a correction to make the estimate statistically unbiased.

min_periods

Minimum number of observations in window required to have a value (otherwise result is null).

Examples

>>> s = pl.Series("a", [1, 2, 3])
>>> s.ewm_std(com=1)
shape: (3,)
Series: 'a' [f64]
[
0.0
0.707107
0.963624
]