def standard_deviation(lengths = nil)
      if lengths.nil?
        lengths = @lengths.map { |x| Array.new(x[1], x[0]) }.flatten
      end

      cluster_mean = mean
      std_deviation = 0
      lengths.each do |len|
        std_deviation += (cluster_mean - len) * (cluster_mean - len)
      end
      std_deviation = Math.sqrt(std_deviation.to_f / (lengths.length - 1))
    end
def standard_deviation(lengths = nil)
      if lengths.nil?
        lengths = @lengths.map { |x| Array.new(x[1], x[0]) }.flatten
      end

      cluster_mean = mean
      std_deviation = 0
      lengths.each do |len|
        std_deviation += (cluster_mean - len) * (cluster_mean - len)
      end
      std_deviation = Math.sqrt(std_deviation.to_f / (lengths.length - 1))
    end
Returns the standard deviation of a set of values
 Params:
 +lengths+: a vector of values (optional, by default it takes the values
 in the cluster)
 Output:
 Real number