@@ -631,25 +631,25 @@ However, for reading convenience, most of the examples show sorted sequences.
631
631
Return the intercept and slope of `simple linear regression
632
632
<https://en.wikipedia.org/wiki/Simple_linear_regression> `_
633
633
parameters estimated using ordinary least squares. Simple linear
634
- regression describes relationship between *regressor * and
635
- *dependent variable * in terms of linear function:
634
+ regression describes the relationship between *regressor * and
635
+ *dependent variable * in terms of this linear function:
636
636
637
637
*dependent_variable = intercept + slope \* regressor + noise *
638
638
639
639
where ``intercept `` and ``slope `` are the regression parameters that are
640
10000
td>- estimated, and noise term is an unobserved random variable, for the
640
+ estimated, and noise represents the
641
641
variability of the data that was not explained by the linear regression
642
- (it is equal to the difference between prediction and the actual values
642
+ (it is equal to the difference between predicted and actual values
643
643
of dependent variable).
644
644
645
645
Both inputs must be of the same length (no less than two), and regressor
646
- needs not to be constant, otherwise :exc: `StatisticsError ` is raised.
646
+ needs not to be constant; otherwise :exc: `StatisticsError ` is raised.
647
647
648
- For example, if we took the data on the data on `release dates of the Monty
648
+ For example, we can use the `release dates of the Monty
649
649
Python films <https://en.wikipedia.org/wiki/Monty_Python#Films> `_, and used
650
- it to predict the cumulative number of Monty Python films produced, we could
651
- predict what would be the number of films they could have made till year
652
- 2019, assuming that they kept the pace.
650
+ it to predict the cumulative number of Monty Python films
651
+ that would have been produced by 2019
652
+ assuming that they kept the pace.
653
653
654
654
.. doctest ::
655
655
@@ -659,14 +659,6 @@ However, for reading convenience, most of the examples show sorted sequences.
659
659
>>> round (intercept + slope * 2019 )
660
660
16
661
661
662
- We could also use it to "predict" how many Monty Python films existed when
663
- Brian Cohen was born.
664
-
665
- .. doctest ::
666
-
667
- >>> round (intercept + slope * 1 )
668
- -610
669
-
670
662
.. versionadded :: 3.10
671
663
672
664
0 commit comments