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: 3 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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