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

Set default ddof value in slope, correlation and intercept methods of Regression class #20

Closed justusgee closed 7 years ago

justusgee commented 7 years ago

Set default ddof value in slope, correlation and intercept methods of Regression class and keep use the same ddof value when calling methods of Statistics in them

justusgee commented 7 years ago

The nosetests -v needs Python 3.3 or later

jbaum-cmcrc commented 7 years ago

Looks like the latest setuptools no longer supports Python 3.2, which is causing the Travis checks to fail.

The resolution is either to drop Python 3.2 suport, or require 'setuptools < 30'; that should not be done on this PR, though, since it's unrelated to the ddof changes.

grantjenks commented 7 years ago

I made ddof=0.0 to match numpy but as I think about it, I don't think it was the right choice. John Cook chose ddof=1.0 which aligns with observing a sample rather than the whole population (which I think is the main scenario).

In 030be25 I changed the code to use ddof=1.0 by default. I also adopted the changes from your merge request (#20) so that ddof=0.0 is possible and should work with the regression objects.

I also included a copy of John's code in the tests directory and have a little program there for running the code and comparing results. Going forward, I'll make sure the output of the Python code matches the C++ code.

Changes released to PyPI at v1.7.1

justusgee commented 7 years ago

Thanks @grantjenks