Skip to content

Skew

Running skew using Welford's algorithm.

Parameters

  • bias – defaults to False

    If False, then the calculations are corrected for statistical bias.

Attributes

  • name

Examples

>>> from river import stats
>>> import numpy as np

>>> np.random.seed(42)
>>> X = np.random.normal(loc=0, scale=1, size=10)

>>> skew = stats.Skew(bias=False)
>>> for x in X:
...     print(skew.update(x).get())
0.0
0.0
-1.4802398132849872
0.5127437186677888
0.7803466510704751
1.056115628922055
0.5057840774320389
0.3478402420400934
0.4536710660918704
0.4123070197493227

>>> skew = stats.Skew(bias=True)
>>> for x in X:
...     print(skew.update(x).get())
0.0
0.0
-0.6043053732501439
0.2960327239981376
0.5234724473423674
0.7712778043924866
0.39022088752624845
0.278892645224261
0.37425953513864063
0.3476878073823696

Methods

get

Return the current value of the statistic.

update

Update and return the called instance.

Parameters

  • x (numbers.Number)

References