mcframework.stats_engine.std#
- mcframework.stats_engine.std(x: ndarray, ctx: StatsContext) float | None[source]#
Sample standard deviation with Bessel correction.
The estimator is
\[s = \sqrt{\frac{1}{n_\text{eff} - \texttt{ddof}} \sum_{i=1}^{n_\text{eff}} (x_i - \bar X)^2 }.\]- Parameters:
- x
ndarray Input sample.
- ctx
StatsContext Uses
ddof(default 1). Ifnan_policy="omit", non-finite values are excluded.- Returns
- ——-
- float or None
\(s\) when \(n_\text{eff} > \texttt{ddof}\), else
None.
- x
Examples
>>> std(np.array([1, 2, 3]), {}) 1.0