lib/linefit.rb
############################################################################
# Return the predicted Y values minus the observed Y values
#
#  residuals = linefit.residuals
#
# The returned list is undefined if the regression fails.
#
Return the predicted Y values minus the observed Y values
residuals = linefit.residuals

The returned list is undefined if the regression fails.
Return the predicted Y values minus the observed Y values residuals = linefit . residuals The returned list is undefined if the regression fails .
def residuals
      unless @residuals
         self.regress or return
         @residuals = []
         0.upto(@numxy-1) do |i|
            @residuals[i] = @y[i] - (@intercept + @slope * @x[i])
         end
      end
      return @residuals
   end
def residuals unless @residuals self . regress or return @residuals = [ ] 0 . upto ( @numxy - 1 ) do | i | @residuals [ i ] = @y [ i ] - ( @intercept + @slope * @x [ i ] ) end end return @residuals end
Return the predicted Y values minus the observed Y values
residuals = linefit.residuals
Return the predicted Y values minus the observed Y values residuals = linefit . residuals