lib/darkext/statistics.rb
# Finds the mean of the array
Finds the mean of the array
Finds the mean of the array
def sum_of_squares
    raise ArgumentError.new('Array size must be > 0') if self.size.zero?
    m = self.mean
    self.map { |v| v - m }.squares.sum
  end
def sum_of_squares raise ArgumentError . new ( 'Array size must be > 0' ) if self . size . zero? m = self . mean self . map { | v | v - m } . squares . sum end
Finds the mean of the array
Finds the mean of the array