Class: Axiom::Aggregate::StandardDeviation
- Inherits:
-
Variance
- Object
- 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.
Instance Method Summary collapse
-
#type ⇒ Class<Attribute::Float>
Return the type returned from #call.
Methods inherited from Variance
Methods inherited from Axiom::Aggregate
#call, #default, default, #finalize
Methods included from Visitable
Methods included from Operation::Unary
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 |
Instance Method Details
#type ⇒ Class<Attribute::Float>
Return the type returned from #call
35 36 37 |
# File 'lib/axiom/aggregate/standard_deviation.rb', line 35 def type Attribute::Float end |