diff --git a/dist/norm.go b/dist/norm.go index ed35acec..25c671ac 100644 --- a/dist/norm.go +++ b/dist/norm.go @@ -100,7 +100,7 @@ func (Normal) ExKurtosis() float64 { // Fit sets the parameters of the probability distribution from the // data samples x with relative weights w. If weights is nil, then all the weights // are 1. If weights is not nil, then the len(weights) must equal len(samples). -func (n *Normal) Fit(samples []float64, weights []float64) { +func (n *Normal) Fit(samples, weights []float64) { suffStat := make([]float64, 1) nSamples := n.SuffStat(samples, weights, suffStat) n.ConjugateUpdate(suffStat, nSamples, []float64{0, 0}) diff --git a/stat.go b/stat.go index 3cf3d665..7d019a47 100644 --- a/stat.go +++ b/stat.go @@ -672,7 +672,7 @@ func Mean(x, weights []float64) float64 { // Mode returns the most common value in the dataset specified by x and the // given weights. Strict float64 equality is used when comparing values, so users // should take caution. If several values are the mode, any of them may be returned. -func Mode(x []float64, weights []float64) (val float64, count float64) { +func Mode(x, weights []float64) (val float64, count float64) { if weights != nil && len(x) != len(weights) { panic("stat: slice length mismatch") } @@ -877,13 +877,13 @@ func (w weightSorter) Len() int { } // StdDev returns the sample standard deviation. -func StdDev(x []float64, weights []float64) float64 { +func StdDev(x, weights []float64) float64 { _, std := MeanStdDev(x, weights) return std } // MeanStdDev returns the sample mean and standard deviation -func MeanStdDev(x []float64, weights []float64) (mean, std float64) { +func MeanStdDev(x, weights []float64) (mean, std float64) { mean, variance := MeanVariance(x, weights) return mean, math.Sqrt(variance) }