This is a javascript regression analysis framework.
Regression analysis is a statistical analysis technique that aims to model relationships between a dependent variable and one or more independent variables.
Linear regression, which is a special case of the general concept of regression analysis, is a statistical technique that attempts to explain an observed dependent variable by one or more independent variables.
Linear regression in 2-dimensional space, which is a special case of the general concept of regression analysis, is a statistical method that attempts to explain an observed dependent variable by one or more independent variables.
var regression = Regression.linear();
regression.addRecord(20, 0);
regression.addRecord(16, 3);
regression.addRecord(15, 7);
regression.addRecord(16, 4);
regression.addRecord(13, 6);
regression.addRecord(10, 10);
var mn = regression.calculate();
console.log(String('y(x) = %s * x + %s').replace(/%s/, mn.m).replace(/%s/, mn.n));
It returns:
y(x) = -0.9821428571428571 * x + 19.732142857142854
- Björn Hempel bjoern@hempel.li - Initial work - https://github.com/bjoern-hempel
This tutorial is licensed under the MIT License - see the LICENSE.md file for details
Have fun! :)