-
Notifications
You must be signed in to change notification settings - Fork 229
Open
Description
Just checking if this worths a PR. Currently Lineal Regression returns m and b, but you always want to check R square attached to see how well the fit was. I know there is a R-square function but would be handy to have this one returned from the function since all formulas are already there.
which will translate to something like:
//Pearson correlation
r = (dataLength * sumXY - sumX * sumY) /
(Math.sqrt(dataLength * sumX2 - sumX * sumX) * Math.sqrt(dataLength * sumY2 - sumY * sumY))
Using the same definitions you have for sumXY, SumY, SumX. I would add sumX2 and sumY2 plus the return value r to the function.
ianstormtaylor
Metadata
Metadata
Assignees
Labels
No labels