lib/more_math/linear_regression.rb
# Returns the residuals of this linear regression in relation to the given
# domain and image.
Returns the residuals of this linear regression in relation to the given
domain and image.
Returns the residuals of this linear regression in relation to the given domain and image .
def residuals
      result = []
      @domain.zip(@image) do |x, y|
        result << y - (@a * x + @b)
      end
      result
    end
def residuals result = [ ] @domain . zip ( @image ) do | x , y | result << y - ( @a * x + @b ) end result end
Returns the residuals of this linear regression in relation to the given
domain and image.
Returns the residuals of this linear regression in relation to the given domain and image .