[issue45766] Add direct proportion option to statistics.linear_regression()

2021-11-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for looking at this and giving it some good thought. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue45766] Add direct proportion option to statistics.linear_regression()

2021-11-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset d2b55b07d2b503dcd3b5c0e2753efa835cff8e8f by Raymond Hettinger in branch 'main': bpo-45766: Add direct proportion option to linear_regression(). (#29490) https://github.com/python/cpython/commit/d2b55b07d2b503dcd3b5c0e2753efa835cff8e8f

[issue45766] Add direct proportion option to statistics.linear_regression()

2021-11-21 Thread Steven D'Aprano
Steven D'Aprano added the comment: Hi Raymond, I'm satisfied that this should be approved. The code looks good to me and in my tests it matches the results from other software. I don't think there is any need to verify that plain OLS regression produces an intercept close to zero. (What

[issue45766] Add direct proportion option to statistics.linear_regression()

2021-11-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: It usually isn't wise to be preachy in the docs, but we could add a suggestion that proportional=True be used only when (0, 0) is known to be in the dataset and when it is in the same neighborhood as the other data points. A reasonable cross-check would

[issue45766] Add direct proportion option to statistics.linear_regression()

2021-11-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: Sure, I’m happy to wait. My thoughts: * The first link you provided does give the same slope across packages. Where they differ is in how they choose to report statistics for assessing goodness of fit or for informing hypothesis testing. Neither of

[issue45766] Add direct proportion option to statistics.linear_regression()

2021-11-10 Thread Steven D'Aprano
Steven D'Aprano added the comment: Hi Raymond, I'm conflicted by this. Regression through the origin is clearly a thing which is often desired. In that sense, I'm happy to see it added, and thank you. But on the other hand, this may open a can of worms that I personally don't feel entirely

[issue45766] Add direct proportion option to statistics.linear_regression()

2021-11-09 Thread Raymond Hettinger
Change by Raymond Hettinger : -- keywords: +patch pull_requests: +27741 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29490 ___ Python tracker

[issue45766] Add direct proportion option to statistics.linear_regression()

2021-11-09 Thread Raymond Hettinger
New submission from Raymond Hettinger : Signature: def linear_regression(x, y, /, *, proportional=False): Additional docstring with example: If *proportional* is true, the independent variable *x* and the dependent variable *y* are assumed to be directly proportional. The