Class: Axiom::Aggregate::StandardDeviation
- Inherits:
-
Variance
- Object
- Function
- Axiom::Aggregate
- Variance
- Axiom::Aggregate::StandardDeviation
- Defined in:
- lib/axiom/aggregate/standard_deviation.rb
Overview
The standard deviation of a sequence of numbers
Defined Under Namespace
Modules: Methods
Constant Summary
Constants inherited from Variance
Instance Attribute Summary
Attributes included from Operation::Unary
Class Method Summary collapse
-
.finalize(_accumulator) ⇒ Float?
Calculate the standard deviation from the accumulator.
-
.type ⇒ Class<Types::Float>
Return the type returned from #call.
Methods inherited from Variance
Methods inherited from Axiom::Aggregate
#call, #default, default, #finalize
Methods included from Operation::Unary
Methods inherited from Function
extract_value, rename_attributes, #type
Methods included from Visitable
Class Method Details
.finalize(_accumulator) ⇒ Float?
Calculate the standard deviation from the accumulator
22 23 24 25 |
# File 'lib/axiom/aggregate/standard_deviation.rb', line 22 def self.finalize(_accumulator) variance = super Math.sqrt(variance) if variance end |
.type ⇒ Class<Types::Float>
Return the type returned from #call
36 37 38 |
# File 'lib/axiom/aggregate/standard_deviation.rb', line 36 def self.type Types::Float end |