class Axiom::Aggregate::StandardDeviation

The standard deviation of a sequence of numbers

Public Class Methods

finalize(_accumulator) click to toggle source

Calculate the standard deviation from the accumulator

@example

standard_deviation = StandardDeviation.finalize(accumulator)

@param [Array(Numeric, Integer, Numeric)] _accumulator

@return [Float]

returned for a non-empty set

@return [nil]

returned for an empty set

@api public

Calls superclass method
# File lib/axiom/aggregate/standard_deviation.rb, line 22
def self.finalize(_accumulator)
  variance = super
  Math.sqrt(variance) if variance
end
type() click to toggle source

Return the type returned from call

@example

type = Axiom::Aggregate::StandardDeviation.type
# => Axiom::Types::Float

@return [Class<Types::Float>]

@api public

# File lib/axiom/aggregate/standard_deviation.rb, line 36
def self.type
  Types::Float
end