This gem adds methods to the Math module to aid in calculating the Least Squares Regression Line given two arrays.
Shane Emmons
gem "least_squares", "~> 1.0.1"