stats

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2021 License: Apache-2.0 Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StandardDeviation

type StandardDeviation struct {
	Name    string
	Sum     float64
	Mean    float64
	Buckets []float64
	Std     float64 // σ
}

StandardDeviation is the struct to calculate and store standard deviation specifically this is a population standard deviation

func NewStandardDeviation

func NewStandardDeviation(name string) StandardDeviation

NewStandardDeviation creates a new standard dev object

func (*StandardDeviation) Add

func (sd *StandardDeviation) Add(num float64)

Add a float64 sample to the bucket

func (*StandardDeviation) Push

func (sd *StandardDeviation) Push(num float64) (std, mean float64, within6Sigma bool)

Push a float64 to calculate standard deviation and returns σ and whether the number is over 6σ in positive right side of bell curve 6σ is at odd of every three weeks

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL