Versions in this module Expand all Collapse all v0 v0.0.1 Mar 8, 2021 Changes in this version + var ErrMismatchedSamples = errors.New("samples have different lengths") + var ErrSampleSize = errors.New("sample is too small") + var ErrSamplesEqual = errors.New("all samples are equal") + var ErrZeroVariance = errors.New("sample has zero variance") + var MannWhitneyExactLimit = 50 + var MannWhitneyTiesExactLimit = 25 + var StdNormal = NormalDist + func Bounds(xs []float64) (min float64, max float64) + func GeoMean(xs []float64) float64 + func InvCDF(dist DistCommon) func(y float64) (x float64) + func Mean(xs []float64) float64 + func Rand(dist DistCommon) func(*rand.Rand) float64 + func StdDev(xs []float64) float64 + func Variance(xs []float64) float64 + type DeltaDist struct + T float64 + func (d DeltaDist) Bounds() (float64, float64) + func (d DeltaDist) CDF(x float64) float64 + func (d DeltaDist) InvCDF(y float64) float64 + func (d DeltaDist) PDF(x float64) float64 + type DiscreteDist interface + PMF func(x float64) float64 + Step func() float64 + type Dist interface + PDF func(x float64) float64 + type DistCommon interface + Bounds func() (float64, float64) + CDF func(x float64) float64 + type LocationHypothesis int + const LocationDiffers + const LocationGreater + const LocationLess + type MannWhitneyUTestResult struct + AltHypothesis LocationHypothesis + N1 int + N2 int + P float64 + U float64 + func MannWhitneyUTest(x1, x2 []float64, alt LocationHypothesis) (*MannWhitneyUTestResult, error) + type NormalDist struct + Mu float64 + Sigma float64 + func (n NormalDist) Bounds() (float64, float64) + func (n NormalDist) CDF(x float64) float64 + func (n NormalDist) InvCDF(p float64) (x float64) + func (n NormalDist) PDF(x float64) float64 + func (n NormalDist) Rand(r *rand.Rand) float64 + type Sample struct + Sorted bool + Weights []float64 + Xs []float64 + func (s *Sample) Sort() *Sample + func (s Sample) Bounds() (min float64, max float64) + func (s Sample) Copy() *Sample + func (s Sample) GeoMean() float64 + func (s Sample) IQR() float64 + func (s Sample) Mean() float64 + func (s Sample) Percentile(pctile float64) float64 + func (s Sample) StdDev() float64 + func (s Sample) Sum() float64 + func (s Sample) Variance() float64 + func (s Sample) Weight() float64 + type TDist struct + V float64 + func (t TDist) Bounds() (float64, float64) + func (t TDist) CDF(x float64) float64 + func (t TDist) PDF(x float64) float64 + type TTestResult struct + AltHypothesis LocationHypothesis + DoF float64 + N1 int + N2 int + P float64 + T float64 + func OneSampleTTest(x TTestSample, μ0 float64, alt LocationHypothesis) (*TTestResult, error) + func PairedTTest(x1, x2 []float64, μ0 float64, alt LocationHypothesis) (*TTestResult, error) + func TwoSampleTTest(x1, x2 TTestSample, alt LocationHypothesis) (*TTestResult, error) + func TwoSampleWelchTTest(x1, x2 TTestSample, alt LocationHypothesis) (*TTestResult, error) + type TTestSample interface + Mean func() float64 + Variance func() float64 + Weight func() float64 + type UDist struct + N1 int + N2 int + T []int + func (d UDist) Bounds() (float64, float64) + func (d UDist) CDF(U float64) float64 + func (d UDist) PMF(U float64) float64 + func (d UDist) Step() float64