haskell / statistics

A fast, high quality library for computing with statistics in Haskell.
http://hackage.haskell.org/package/statistics
BSD 2-Clause "Simplified" License
300 stars 68 forks source link

skewness (and kurtosis) 0 when stdev=0 #172

Open ozgurakgun opened 3 years ago

ozgurakgun commented 3 years ago

A colleage tells me this is commonly done. I think scipy does the same: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.skew.html

Sorry I don't know very much about this subject, but wanted to make an issue just in case this is something that needs improving.

To be clear, currently the statictics package returns skewness=NaN when stdev=0. AFAIU there are valid arguments to return skewness=0 in this case instead.

Kurtosis is slightly more complex since there are 2 common versions Pearson/Fisher. Apparently for Pearson kurtosis=0 is a sensible default and kurtosis=-3 for Fisher.