Hi-Folks / statistics

PHP package that provides functions for calculating mathematical statistics of numeric data.

Home Page:https://packagist.org/packages/hi-folks/statistics

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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