summaryrefslogtreecommitdiffstats
path: root/Doc/library/statistics.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library/statistics.rst')
-rw-r--r--Doc/library/statistics.rst12
1 files changed, 11 insertions, 1 deletions
diff --git a/Doc/library/statistics.rst b/Doc/library/statistics.rst
index bb03a2c..8638abf 100644
--- a/Doc/library/statistics.rst
+++ b/Doc/library/statistics.rst
@@ -643,7 +643,7 @@ However, for reading convenience, most of the examples show sorted sequences.
.. versionadded:: 3.10
-.. function:: linear_regression(x, y, /)
+.. function:: linear_regression(x, y, /, *, proportional=False)
Return the slope and intercept of `simple linear regression
<https://en.wikipedia.org/wiki/Simple_linear_regression>`_
@@ -677,8 +677,18 @@ However, for reading convenience, most of the examples show sorted sequences.
>>> round(slope * 2019 + intercept)
16
+ If *proportional* is true, the independent variable *x* and the
+ dependent variable *y* are assumed to be directly proportional.
+ The data is fit to a line passing through the origin.
+ Since the *intercept* will always be 0.0, the underlying linear
+ function simplifies to:
+
+ *y = slope \* x + noise*
+
.. versionadded:: 3.10
+ .. versionchanged:: 3.11
+ Added support for *proportional*.
Exceptions
----------