Class: Alf::Aggregator::Stddev

Inherits:
Variance show all
Defined in:
lib/alf/aggregator/stddev.rb

Overview

Defines a `stddev()` aggregation operator.

Example:

# direct ruby usage
Alf::Aggregator.stddev{ qty }.aggregate(...)

# lispy 
(summarize :supplies, [:sid], :stddev => stddev{ qty })

Instance Attribute Summary

Attributes inherited from Alf::Aggregator

#functor, #options, #source

Instance Method Summary collapse

Methods inherited from Variance

#_happens, #least

Methods inherited from Alf::Aggregator

#==, #aggregate, coerce, #default_options, #happens, #has_source_code!, #infer_type, inherited, #initialize, #least, #to_lispy

Methods included from Support::Registry

#each, #listen, #listeners, #register, #registered

Constructor Details

This class inherits a constructor from Alf::Aggregator

Instance Method Details

#finalize(memo) ⇒ Object

Finalizes the computation.

See Also:

  • Aggregator::InstanceMethods#finalize

19
20
21
# File 'lib/alf/aggregator/stddev.rb', line 19

def finalize(memo) 
  Math.sqrt(super(memo))
end