[issue38490] statistics: add covariance and Pearson's correlation

2019-10-17 Thread Tim Peters
Tim Peters added the comment: I'm in favor of adding all of this (covariance, coefficient, linear regression). It's still at the level of elementary statistics, and even taught in watered down "business statistics" classes. It's about the minimum that can be done beyond single-variable

[issue38490] statistics: add covariance and Pearson's correlation

2019-10-17 Thread Tymek Wołodźko
Tymek Wołodźko added the comment: I expanded my PR to add simple linear regression. I also created documentation for the new functionalities. As about covariance, we can simply not expose it to the users, but I'm not convinced that there is any gain in keeping it hidden from the users. Tim

[issue38490] statistics: add covariance and Pearson's correlation

2019-10-16 Thread Tymek Wołodźko
Tymek Wołodźko added the comment: In case there is agreement with Steven, I will add simple linear regression ( https://en.wikipedia.org/wiki/Simple_linear_regression ) in the same PR, since it is just: slope = correlation(x, y) * ( stdev(y) / stdev(x) ) intercept = mean(y) - slope * mean(x)

[issue38490] statistics: add covariance and Pearson's correlation

2019-10-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: I can't speak for other countries, but in Australia, secondary school mathematics teaches correlation coefficient and linear regression from Year 11 onwards (typically ages 16 or 17). Covariance is not itself taught, and as far as I can tell neither the

[issue38490] statistics: add covariance and Pearson's correlation

2019-10-16 Thread Tymek Wołodźko
Tymek Wołodźko added the comment: I think I see your point, that the module is intended for the most basic features, but I would argue that correlation is one of such "most basic" statistics. Correlation and covariance can be thought as equivalents for standard deviation and variance, but when

[issue38490] statistics: add covariance and Pearson's correlation

2019-10-15 Thread Raymond Hettinger
Change by Raymond Hettinger : -- components: +Library (Lib) versions: -Python 3.8 ___ Python tracker ___ ___ Python-bugs-list

[issue38490] statistics: add covariance and Pearson's correlation

2019-10-15 Thread Raymond Hettinger
Raymond Hettinger added the comment: These two functions are right on the boundary edge of what the statistics module is trying to do, """The module is not intended to be a competitor to third-party libraries such as NumPy, SciPy, or proprietary full-featured statistics packages aimed at

[issue38490] statistics: add covariance and Pearson's correlation

2019-10-15 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +16364 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16813 ___ Python tracker ___

[issue38490] statistics: add covariance and Pearson's correlation

2019-10-15 Thread Tymek Wołodźko
New submission from Tymek Wołodźko : Covariance and Pearson's correlation are one of the most basic bivariate statistics. https://en.wikipedia.org/wiki/Covariance https://en.wikipedia.org/wiki/Pearson_correlation_coefficient -- messages: 354754 nosy: Tymek Wołodźko priority: normal