method

fit_linear

v1_9_3_125 - Show latest stable - Class: MiniTest::Unit::TestCase
fit_linear(xs, ys)
public

Fits the functional form: a + bx.

Takes x and y values and returns [a, b, r^2].

See: http://mathworld.wolfram.com/LeastSquaresFitting.html