Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidValue = errors.New("NaN or +-Inf are not allowed")
ErrInvalidValue means that the item you supplied is a NaN or an Inf which is considered illegal.
Functions ¶
This section is empty.
Types ¶
type Variability ¶
type Variability interface { Min() float64 Max() float64 Mean() float64 StandardDeviation() float64 Count() int }
Variability is a measure of how spread out is your dataset.
type WelfordSink ¶
type WelfordSink struct { Sink Variability // contains filtered or unexported fields }
WelfordSink is an implementation of a Sink and Variability @TODO make this goroutine-safe
func NewSink ¶
func NewSink() *WelfordSink
NewSink returns a pointer to an implementation of interfaces Sink & Variability
func (*WelfordSink) Count ¶
func (s *WelfordSink) Count() int
Count returns the number of observations that was seen thus far.
func (*WelfordSink) Max ¶
func (s *WelfordSink) Max() float64
Max returns the largest observation seen.
func (*WelfordSink) Mean ¶
func (s *WelfordSink) Mean() float64
Mean returns the arithmetic mean of all the observations.
func (*WelfordSink) Min ¶
func (s *WelfordSink) Min() float64
Min returns the smallest observation seen.
func (*WelfordSink) Push ¶
func (s *WelfordSink) Push(x float64) error
Push accepts an observation. On failure, it returns an ErrInvalidValue.
func (*WelfordSink) StandardDeviation ¶
func (s *WelfordSink) StandardDeviation() float64
StandardDeviation returns the running sd of the observations