Linear Regression
roberto-butti opened this issue · comments
In Stat class (src/Stat.php) add a new static function named linearRegression for returning the slope and intercept of simple linear regression parameters estimated using ordinary least squares. Simple linear regression describes the relationship between an independent variable x and a dependent variable y in terms of this linear function.
Python implementation: https://github.com/python/cpython/blob/v3.10.2/Lib/statistics.py#L925
Documentation:
https://docs.python.org/3/library/statistics.html#statistics.linear_regression