#106 Linear Regression

open
nobody
General (22)
5
2012-09-19
2009-01-22
No

It seems like it calculates the step size on the X-Axis wrong, the calculation is now:
double stepSize = (maxX - minX) / (pointCount);

so if you have 2 points to calculate on where
maxX=1 and minX=0 (only two points) then the step size is = 0.5 but is shoud actually have been 1.0

This gives the right result:
double stepSize = (maxX - minX) / (pointCount-1);

Discussion