| 1 | <?php |
||
| 8 | class Math |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * Determine slope and intercept variables of the affine function |
||
| 12 | * that best fit the given datapoints |
||
| 13 | * |
||
| 14 | * @param array $data Array keys as x axis and values as y axis |
||
| 15 | * |
||
| 16 | * @return array Like ['slope' => float, 'intercept' => float] |
||
| 17 | */ |
||
| 18 | 6 | public static function linearRegression(array $data) |
|
| 50 | } |
||
| 51 |