olsRegress Perform an ordinary least-squares regression on a set of predictors, and calculate the goodness-of-fit of the regression.
The returned pair consists of:
A vector of regression coefficients. This vector has one more element than the list of predictors; the last element is the y-intercept value.
R², the coefficient of determination (see rSquare for details).
import qualified Data.Vector.Unboxed as VU:{ olsRegress [ VU.fromList [0,1,2,3] ] (VU.fromList [1000, 1001, 1002, 1003]):}([1.0000000000000218,999.9999999999999],1.0)