<commit_before>

# stats
`import "github.com/montanaflynn/stats"`

* [Overview](#pkg-overview)
* [Index](#pkg-index)
* [Examples](#pkg-examples)
* [Subdirectories](#pkg-subdirectories)

## <a name="pkg-overview">Overview</a>
Package stats is a well tested and comprehensive
statistics library package with no dependencies.

Example Usage:


	// start with some source data to use
	data := []float64{1.0, 2.1, 3.2, 4.823, 4.1, 5.8}
	
	// you could also use different types like this
	// data := stats.LoadRawData([]int{1, 2, 3, 4, 5})
	// data := stats.LoadRawData([]interface{}{1.1, "2", 3})
	// etc...
	
	median, _ := stats.Median(data)
	fmt.Println(median) // 3.65
	
	roundedMedian, _ := stats.Round(median, 0)
	fmt.Println(roundedMedian) // 4

MIT License Copyright (c) 2014-2020 <NAME> (<a href="https://montanaflynn.com">https://montanaflynn.com</a>)




## <a name="pkg-index">Index</a>
* [Variables](#pkg-variables)
* [func AutoCorrelation(data Float64Data, lags int) (float64, error)](#AutoCorrelation)
* [func ChebyshevDistance(dataPointX, dataPointY Float64Data) (distance float64, err error)](#ChebyshevDistance)
* [func Correlation(data1, data2 Float64Data) (float64, error)](#Correlation)
* [func Covariance(data1, data2 Float64Data) (float64, error)](#Covariance)
* [func CovariancePopulation(data1, data2 Float64Data) (float64, error)](#CovariancePopulation)
* [func CumulativeSum(input Float64Data) ([]float64, error)](#CumulativeSum)
* [func Entropy(input Float64Data) (float64, error)](#Entropy)
* [func EuclideanDistance(dataPointX, dataPointY Float64Data) (distance float64, err error)](#EuclideanDistance)
* [func GeometricMean(input Float64Data) (float64, error)](#GeometricMean)
* [func HarmonicMean(input Float64Data) (float64, error)](#HarmonicMean)
* [func InterQuartileRange(input Float64Data) (float64, error)](#InterQuartileRange)
* [func ManhattanDistance(dataPointX, dataPointY Float64Data) (distance float64, err error)](#ManhattanDistance)
* [func Max(input Float64Data) (max float64, err error)](#Max)
* [func Mean(input Float64Data) (float64, error)](#Mean)
* [func Median(input Float64Data) (median float64, err error)](#Median)
* [func MedianAbsoluteDeviation(input Float64Data) (mad float64, err error)](#MedianAbsoluteDeviation)
* [func MedianAbsoluteDeviationPopulation(input Float64Data) (mad float64, err error)](#MedianAbsoluteDeviationPopulation)
* [func Midhinge(input Float64Data) (float64, error)](#Midhinge)
* [func Min(input Float64Data) (min float64, err error)](#Min)
* [func MinkowskiDistance(dataPointX, dataPointY Float64Data, lambda float64) (distance float64, err error)](#MinkowskiDistance)
* [func Mode(input Float64Data) (mode []float64, err error)](#Mode)
* [func Ncr(n, r int) int](#Ncr)
* [func NormBoxMullerRvs(loc float64, scale float64, size int) []float64](#NormBoxMullerRvs)
* [func NormCdf(x float64, loc float64, scale float64) float64](#NormCdf)
* [func NormEntropy(loc float64, scale float64) float64](#NormEntropy)
* [func NormFit(data []float64) [2]float64](#NormFit)
* [func NormInterval(alpha float64, loc float64, scale float64) [2]float64](#NormInterval)
* [func NormIsf(p float64, loc float64, scale float64) (x float64)](#NormIsf)
* [func NormLogCdf(x float64, loc float64, scale float64) float64](#NormLogCdf)
* [func NormLogPdf(x float64, loc float64, scale float64) float64](#NormLogPdf)
* [func NormLogSf(x float64, loc float64, scale float64) float64](#NormLogSf)
* [func NormMean(loc float64, scale float64) float64](#NormMean)
* [func NormMedian(loc float64, scale float64) float64](#NormMedian)
* [func NormMoment(n int, loc float64, scale float64) float64](#NormMoment)
* [func NormPdf(x float64, loc float64, scale float64) float64](#NormPdf)
* [func NormPpf(p float64, loc float64, scale float64) (x float64)](#NormPpf)
* [func NormPpfRvs(loc float64, scale float64, size int) []float64](#NormPpfRvs)
* [func NormSf(x float64, loc float64, scale float64) float64](#NormSf)
* [func NormStats(loc float64, scale float64, moments string) []float64](#NormStats)
* [func NormStd(loc float64, scale float64) float64](#NormStd)
* [func NormVar(loc float64, scale float64) float64](#NormVar)
* [func Pearson(data1, data2 Float64Data) (float64, error)](#Pearson)
* [func Percentile(input Float64Data, percent float64) (percentile float64, err error)](#Percentile)
* [func PercentileNearestRank(input Float64Data, percent float64) (percentile float64, err error)](#PercentileNearestRank)
* [func PopulationVariance(input Float64Data) (pvar float64, err error)](#PopulationVariance)
* [func Round(input float64, places int) (rounded float64, err error)](#Round)
* [func Sample(input Float64Data, takenum int, replacement bool) ([]float64, error)](#Sample)
* [func SampleVariance(input Float64Data) (svar float64, err error)](#SampleVariance)
* [func Sigmoid(input Float64Data) ([]float64, error)](#Sigmoid)
* [func SoftMax(input Float64Data) ([]float64, error)](#SoftMax)
* [func StableSample(input Float64Data, takenum int) ([]float64, error)](#StableSample)
* [func StandardDeviation(input Float64Data) (sdev float64, err error)](#StandardDeviation)
* [func StandardDeviationPopulation(input Float64Data) (sdev float64, err error)](#StandardDeviationPopulation)
* [func StandardDeviationSample(input Float64Data) (sdev float64, err error)](#StandardDeviationSample)
* [func StdDevP(input Float64Data) (sdev float64, err error)](#StdDevP)
* [func StdDevS(input Float64Data) (sdev float64, err error)](#StdDevS)
* [func Sum(input Float64Data) (sum float64, err error)](#Sum)
* [func Trimean(input Float64Data) (float64, error)](#Trimean)
* [func VarP(input Float64Data) (sdev float64, err error)](#VarP)
* [func VarS(input Float64Data) (sdev float64, err error)](#VarS)
* [func Variance(input Float64Data) (sdev float64, err error)](#Variance)
* [type Coordinate](#Coordinate)
  * [func ExpReg(s []Coordinate) (regressions []Coordinate, err error)](#ExpReg)
  * [func LinReg(s []Coordinate) (regressions []Coordinate, err error)](#LinReg)
  * [func LogReg(s []Coordinate) (regressions []Coordinate, err error)](#LogReg)
* [type Float64Data](#Float64Data)
  * [func LoadRawData(raw interface{}) (f Float64Data)](#LoadRawData)
  * [func (f Float64Data) AutoCorrelation(lags int) (float64, error)](#Float64Data.AutoCorrelation)
  * [func (f Float64Data) Correlation(d Float64Data) (float64, error)](#Float64Data.Correlation)
  * [func (f Float64Data) Covariance(d Float64Data) (float64, error)](#Float64Data.Covariance)
  * [func (f Float64Data) CovariancePopulation(d Float64Data) (float64, error)](#Float64Data.CovariancePopulation)
  * [func (f Float64Data) CumulativeSum() ([]float64, error)](#Float64Data.CumulativeSum)
  * [func (f Float64Data) Entropy() (float64, error)](#Float64Data.Entropy)
  * [func (f Float64Data) GeometricMean() (float64, error)](#Float64Data.GeometricMean)
  * [func (f Float64Data) Get(i int) float64](#Float64Data.Get)
  * [func (f Float64Data) HarmonicMean() (float64, error)](#Float64Data.HarmonicMean)
  * [func (f Float64Data) InterQuartileRange() (float64, error)](#Float64Data.InterQuartileRange)
  * [func (f Float64Data) Len() int](#Float64Data.Len)
  * [func (f Float64Data) Less(i, j int) bool](#Float64Data.Less)
  * [func (f Float64Data) Max() (float64, error)](#Float64Data.Max)
  * [func (f Float64Data) Mean() (float64, error)](#Float64Data.Mean)
  * [func (f Float64Data) Median() (float64, error)](#Float64Data.Median)
  * [func (f Float64Data) MedianAbsoluteDeviation() (float64, error)](#Float64Data.MedianAbsoluteDeviation)
  * [func (f Float64Data) MedianAbsoluteDeviationPopulation() (float64, error)](#Float64Data.MedianAbsoluteDeviationPopulation)
  * [func (f Float64Data) Midhinge(d Float64Data) (float64, error)](#Float64Data.Midhinge)
  * [func (f Float64Data) Min() (float64, error)](#Float64Data.Min)
  * [func (f Float64Data) Mode() ([]float64, error)](#Float64Data.Mode)
  * [func (f Float64Data) Pearson(d Float64Data) (float64, error)](#Float64Data.Pearson)
  * [func (f Float64Data) Percentile(p float64) (float64, error)](#Float64Data.Percentile)
  * [func (f Float64Data) PercentileNearestRank(p float64) (float64, error)](#Float64Data.PercentileNearestRank)
  * [func (f Float64Data) PopulationVariance() (float64, error)](#Float64Data.PopulationVariance)
  * [func (f Float64Data) Quartile(d Float64Data) (Quartiles, error)](#Float64Data.Quartile)
  * [func (f Float64Data) QuartileOutliers() (Outliers, error)](#Float64Data.QuartileOutliers)
  * [func (f Float64Data) Sample(n int, r bool) ([]float64, error)](#Float64Data.Sample)
  * [func (f Float64Data) SampleVariance() (float64, error)](#Float64Data.SampleVariance)
  * [func (f Float64Data) Sigmoid() ([]float64, error)](#Float64Data.Sigmoid)
  * [func (f Float64Data) SoftMax() ([]float64, error)](#Float64Data.SoftMax)
  * [func (f Float64Data) StandardDeviation() (float64, error)](#Float64Data.StandardDeviation)
  * [func (f Float64Data) StandardDeviationPopulation() (float64, error)](#Float64Data.StandardDeviationPopulation)
  * [func (f Float64Data) StandardDeviationSample() (float64, error)](#Float64Data.StandardDeviationSample)
  * [func (f Float64Data) Sum() (float64, error)](#Float64Data.Sum)
  * [func (f Float64Data) Swap(i, j int)](#Float64Data.Swap)
  * [func (f Float64Data) Trimean(d Float64Data) (float64, error)](#Float64Data.Trimean)
  * [func (f Float64Data) Variance() (float64, error)](#Float64Data.Variance)
* [type Outliers](#Outliers)
  * [func QuartileOutliers(input Float64Data) (Outliers, error)](#QuartileOutliers)
* [type Quartiles](#Quartiles)
  * [func Quartile(input Float64Data) (Quartiles, error)](#Quartile)
* [type Series](#Series)
  * [func ExponentialRegression(s Series) (regressions Series, err error)](#ExponentialRegression)
  * [func LinearRegression(s Series) (regressions Series, err error)](#LinearRegression)
  * [func LogarithmicRegression(s Series) (regressions Series, err error)](#LogarithmicRegression)

#### <a name="pkg-examples">Examples</a>
* [AutoCorrelation](#example_AutoCorrelation)
* [ChebyshevDistance](#example_ChebyshevDistance)
* [Correlation](#example_Correlation)
* [Entropy](#example_Entropy)
* [LinearRegression](#example_LinearRegression)
* [Max](#example_Max)
* [Min](#example_Min)
* [Round](#example_Round)
* [Sigmoid](#example_Sigmoid)
* [SoftMax](#example_SoftMax)<commit_msg>Update documentation using godoc2md<commit_after>

# stats
`import "github.com/montanaflynn/stats"`

* [Overview](#pkg-overview)
* [Index](#pkg-index)
* [Examples](#pkg-examples)
* [Subdirectories](#pkg-subdirectories)

## <a name="pkg-overview">Overview</a>
Package stats is a well tested and comprehensive
statistics library package with no dependencies.

Example Usage:


	// start with some source data to use
	data := []float64{1.0, 2.1, 3.2, 4.823, 4.1, 5.8}
	
	// you could also use different types like this
	// data := stats.LoadRawData([]int{1, 2, 3, 4, 5})
	// data := stats.LoadRawData([]interface{}{1.1, "2", 3})
	// etc...
	
	median, _ := stats.Median(data)
	fmt.Println(median) // 3.65
	
	roundedMedian, _ := stats.Round(median, 0)
	fmt.Println(roundedMedian) // 4

MIT License Copyright (c) 2014-2020 <NAME> (<a href="https://montanaflynn.com">https://montanaflynn.com</a>)




## <a name="pkg-index">Index</a>
* [Variables](#pkg-variables)
* [func AutoCorrelation(data Float64Data, lags int) (float64, error)](#AutoCorrelation)
* [func ChebyshevDistance(dataPointX, dataPointY Float64Data) (distance float64, err error)](#ChebyshevDistance)
* [func Correlation(data1, data2 Float64Data) (float64, error)](#Correlation)
* [func Covariance(data1, data2 Float64Data) (float64, error)](#Covariance)
* [func CovariancePopulation(data1, data2 Float64Data) (float64, error)](#CovariancePopulation)
* [func CumulativeSum(input Float64Data) ([]float64, error)](#CumulativeSum)
* [func Entropy(input Float64Data) (float64, error)](#Entropy)
* [func EuclideanDistance(dataPointX, dataPointY Float64Data) (distance float64, err error)](#EuclideanDistance)
* [func GeometricMean(input Float64Data) (float64, error)](#GeometricMean)
* [func HarmonicMean(input Float64Data) (float64, error)](#HarmonicMean)
* [func InterQuartileRange(input Float64Data) (float64, error)](#InterQuartileRange)
* [func ManhattanDistance(dataPointX, dataPointY Float64Data) (distance float64, err error)](#ManhattanDistance)
* [func Max(input Float64Data) (max float64, err error)](#Max)
* [func Mean(input Float64Data) (float64, error)](#Mean)
* [func Median(input Float64Data) (median float64, err error)](#Median)
* [func MedianAbsoluteDeviation(input Float64Data) (mad float64, err error)](#MedianAbsoluteDeviation)
* [func MedianAbsoluteDeviationPopulation(input Float64Data) (mad float64, err error)](#MedianAbsoluteDeviationPopulation)
* [func Midhinge(input Float64Data) (float64, error)](#Midhinge)
* [func Min(input Float64Data) (min float64, err error)](#Min)
* [func MinkowskiDistance(dataPointX, dataPointY Float64Data, lambda float64) (distance float64, err error)](#MinkowskiDistance)
* [func Mode(input Float64Data) (mode []float64, err error)](#Mode)
* [func Ncr(n, r int) int](#Ncr)
* [func NormBoxMullerRvs(loc float64, scale float64, size int) []float64](#NormBoxMullerRvs)
* [func NormCdf(x float64, loc float64, scale float64) float64](#NormCdf)
* [func NormEntropy(loc float64, scale float64) float64](#NormEntropy)
* [func NormFit(data []float64) [2]float64](#NormFit)
* [func NormInterval(alpha float64, loc float64, scale float64) [2]float64](#NormInterval)
* [func NormIsf(p float64, loc float64, scale float64) (x float64)](#NormIsf)
* [func NormLogCdf(x float64, loc float64, scale float64) float64](#NormLogCdf)
* [func NormLogPdf(x float64, loc float64, scale float64) float64](#NormLogPdf)
* [func NormLogSf(x float64, loc float64, scale float64) float64](#NormLogSf)
* [func NormMean(loc float64, scale float64) float64](#NormMean)
* [func NormMedian(loc float64, scale float64) float64](#NormMedian)
* [func NormMoment(n int, loc float64, scale float64) float64](#NormMoment)
* [func NormPdf(x float64, loc float64, scale float64) float64](#NormPdf)
* [func NormPpf(p float64, loc float64, scale float64) (x float64)](#NormPpf)
* [func NormPpfRvs(loc float64, scale float64, size int) []float64](#NormPpfRvs)
* [func NormSf(x float64, loc float64, scale float64) float64](#NormSf)
* [func NormStats(loc float64, scale float64, moments string) []float64](#NormStats)
* [func NormStd(loc float64, scale float64) float64](#NormStd)
* [func NormVar(loc float64, scale float64) float64](#NormVar)
* [func Pearson(data1, data2 Float64Data) (float64, error)](#Pearson)
* [func Percentile(input Float64Data, percent float64) (percentile float64, err error)](#Percentile)
* [func PercentileNearestRank(input Float64Data, percent float64) (percentile float64, err error)](#PercentileNearestRank)
* [func PopulationVariance(input Float64Data) (pvar float64, err error)](#PopulationVariance)
* [func Round(input float64, places int) (rounded float64, err error)](#Round)
* [func Sample(input Float64Data, takenum int, replacement bool) ([]float64, error)](#Sample)
* [func SampleVariance(input Float64Data) (svar float64, err error)](#SampleVariance)
* [func Sigmoid(input Float64Data) ([]float64, error)](#Sigmoid)
* [func SoftMax(input Float64Data) ([]float64, error)](#SoftMax)
* [func StableSample(input Float64Data, takenum int) ([]float64, error)](#StableSample)
* [func StandardDeviation(input Float64Data) (sdev float64, err error)](#StandardDeviation)
* [func StandardDeviationPopulation(input Float64Data) (sdev float64, err error)](#StandardDeviationPopulation)
* [func StandardDeviationSample(input Float64Data) (sdev float64, err error)](#StandardDeviationSample)
* [func StdDevP(input Float64Data) (sdev float64, err error)](#StdDevP)
* [func StdDevS(input Float64Data) (sdev float64, err error)](#StdDevS)
* [func Sum(input Float64Data) (sum float64, err error)](#Sum)
* [func Trimean(input Float64Data) (float64, error)](#Trimean)
* [func VarP(input Float64Data) (sdev float64, err error)](#VarP)
* [func VarS(input Float64Data) (sdev float64, err error)](#VarS)
* [func Variance(input Float64Data) (sdev float64, err error)](#Variance)
* [type Coordinate](#Coordinate)
  * [func ExpReg(s []Coordinate) (regressions []Coordinate, err error)](#ExpReg)
  * [func LinReg(s []Coordinate) (regressions []Coordinate, err error)](#LinReg)
  * [func LogReg(s []Coordinate) (regressions []Coordinate, err error)](#LogReg)
* [type Float64Data](#Float64Data)
  * [func LoadRawData(raw interface{}) (f Float64Data)](#LoadRawData)
  * [func (f Float64Data) AutoCorrelation(lags int) (float64, error)](#Float64Data.AutoCorrelation)
  * [func (f Float64Data) Correlation(d Float64Data) (float64, error)](#Float64Data.Correlation)
  * [func (f Float64Data) Covariance(d Float64Data) (float64, error)](#Float64Data.Covariance)
  * [func (f Float64Data) CovariancePopulation(d Float64Data) (float64, error)](#Float64Data.CovariancePopulation)
  * [func (f Float64Data) CumulativeSum() ([]float64, error)](#Float64Data.CumulativeSum)
  * [func (f Float64Data) Entropy() (float64, error)](#Float64Data.Entropy)
  * [func (f Float64Data) GeometricMean() (float64, error)](#Float64Data.GeometricMean)
  * [func (f Float64Data) Get(i int) float64](#Float64Data.Get)
  * [func (f Float64Data) HarmonicMean() (float64, error)](#Float64Data.HarmonicMean)
  * [func (f Float64Data) InterQuartileRange() (float64, error)](#Float64Data.InterQuartileRange)
  * [func (f Float64Data) Len() int](#Float64Data.Len)
  * [func (f Float64Data) Less(i, j int) bool](#Float64Data.Less)
  * [func (f Float64Data) Max() (float64, error)](#Float64Data.Max)
  * [func (f Float64Data) Mean() (float64, error)](#Float64Data.Mean)
  * [func (f Float64Data) Median() (float64, error)](#Float64Data.Median)
  * [func (f Float64Data) MedianAbsoluteDeviation() (float64, error)](#Float64Data.MedianAbsoluteDeviation)
  * [func (f Float64Data) MedianAbsoluteDeviationPopulation() (float64, error)](#Float64Data.MedianAbsoluteDeviationPopulation)
  * [func (f Float64Data) Midhinge(d Float64Data) (float64, error)](#Float64Data.Midhinge)
  * [func (f Float64Data) Min() (float64, error)](#Float64Data.Min)
  * [func (f Float64Data) Mode() ([]float64, error)](#Float64Data.Mode)
  * [func (f Float64Data) Pearson(d Float64Data) (float64, error)](#Float64Data.Pearson)
  * [func (f Float64Data) Percentile(p float64) (float64, error)](#Float64Data.Percentile)
  * [func (f Float64Data) PercentileNearestRank(p float64) (float64, error)](#Float64Data.PercentileNearestRank)
  * [func (f Float64Data) PopulationVariance() (float64, error)](#Float64Data.PopulationVariance)
  * [func (f Float64Data) Quartile(d Float64Data) (Quartiles, error)](#Float64Data.Quartile)
  * [func (f Float64Data) QuartileOutliers() (Outliers, error)](#Float64Data.QuartileOutliers)
  * [func (f Float64Data) Sample(n int, r bool) ([]float64, error)](#Float64Data.Sample)
  * [func (f Float64Data) SampleVariance() (float64, error)](#Float64Data.SampleVariance)
  * [func (f Float64Data) Sigmoid() ([]float64, error)](#Float64Data.Sigmoid)
  * [func (f Float64Data) SoftMax() ([]float64, error)](#Float64Data.SoftMax)
  * [func (f Float64Data) StandardDeviation() (float64, error)](#Float64Data.StandardDeviation)
  * [func (f Float64Data) StandardDeviationPopulation() (float64, error)](#Float64Data.StandardDeviationPopulation)
  * [func (f Float64Data) StandardDeviationSample() (float64, error)](#Float64Data.StandardDeviationSample)
  * [func (f Float64Data) Sum() (float64, error)](#Float64Data.Sum)
  * [func (f Float64Data) Swap(i, j int)](#Float64Data.Swap)
  * [func (f Float64Data) Trimean(d Float64Data) (float64, error)](#Float64Data.Trimean)
  * [func (f Float64Data) Variance() (float64, error)](#Float64Data.Variance)
* [type Outliers](#Outliers)
  * [func QuartileOutliers(input Float64Data) (Outliers, error)](#QuartileOutliers)
* [type Quartiles](#Quartiles)
  * [func Quartile(input Float64Data) (Quartiles, error)](#Quartile)
* [type Series](#Series)
  * [func ExponentialRegression(s Series) (regressions Series, err error)](#ExponentialRegression)
  * [func LinearRegression(s Series) (regressions Series, err error)](#LinearRegression)
  * [func LogarithmicRegression(s Series) (regressions Series, err error)](#LogarithmicRegression)

#### <a name="pkg-examples">Examples</a>
* [AutoCorrelation](#example_AutoCorrelation)
* [ChebyshevDistance](#example_ChebyshevDistance)
* [Correlation](#example_Correlation)
* [CumulativeSum](#example_CumulativeSum)
* [Entropy](#example_Entropy)
* [LinearRegression](#example_LinearRegression)
* [LoadRawData](#example_LoadRawData)
* [Max](#example_Max)
* [Median](#example_Median)
* [Min](#example_Min)
* [Round](#example_Round)
* [Sigmoid](#example_Sigmoid)
* [SoftMax](#example_SoftMax)
{'fraction_non_alphanumeric': 0.1540084388185654, 'fraction_numerical': 0.05643459915611814, 'mean_word_length': 7.87531914893617, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6911250', 'n_tokens_mistral': 8119, 'n_tokens_neox': 6860, 'n_words': 1635}