Documentation
¶
Overview ¶
Provides some basic statisitcs functionality. Specifically tailored around dealing with large streams of data It's a Go implimentation of this:
https://www.johndcook.com/blog/skewness_kurtosis/
Example program:
package main
import (
"git.riedstra.us/go/stats"
"fmt"
)
func main() {
myFakeStreamOfData := []float64{01, 04, 60, 55, 80, 06, 75, 51, 63, 10}
myStats := &stats.Stats{}
for _, entry := range myFakeStreamOfData {
myStats.Push(entry)
}
fmt.Println(myStats.PrettyStats())
}
Example output:
Mean: 40.50 Variance: 996.72 Standard Deviation: 31.57 Skewness: -0.20 Kurtosis: -1.66
Index ¶
- type Stats
- func (s *Stats) Clear()
- func (s *Stats) Internals() string
- func (s *Stats) Kurtosis() float64
- func (s *Stats) Mean() float64
- func (s *Stats) NumValues() float64
- func (s *Stats) PrettyStats() string
- func (s *Stats) Push(x float64)
- func (s *Stats) Skewness() float64
- func (s *Stats) StandardDeviation() float64
- func (s *Stats) Variance() float64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Stats ¶
Structure used to hold the information about the dataset. several methods are exposed in order to make your life easy
func (*Stats) Internals ¶
Returns a string containing all of the data within the struct
func (*Stats) PrettyStats ¶
Prints each calculated statistic on a line with one tab preceding it
func (*Stats) Push ¶
This function is used to push numbers onto the struct and calculate on the fly the necessary information to output relevant statistics
Source Files
¶
- print.go
- stats.go
Click to show internal directories.
Click to hide internal directories.