grantjenks / python-runstats

Python module for computing statistics and regression in a single pass.
http://grantjenks.com/docs/runstats/
Other
96 stars 19 forks source link

Support for specifying degrees of freedom #17

Closed acordiner closed 7 years ago

acordiner commented 7 years ago

This adds support for specifying degrees of freedom when calculating variance and standard deviation. I'm not sure if there are any corresponding changes to the docs that should be made.

Note: I believe it also fixes a bug in the unit tests: previously the variance()/stdev() functions in runstats were using a denominator of N-1 but the mean()/variance() functions in the unit tests were using a denominator of N.

grantjenks commented 7 years ago

Looks good but can you change the default ddof to 0.0 to match numpy and the existing behavior?

acordiner commented 7 years ago

Sure thing, done