stat/distuv/Laplace Fit panics when weights is nil
Created by: mestorlx
What are you trying to do?
According to the documentation
// If weights is nil, then all the weights are 1.
func (l *Laplace) Fit(samples, weights []float64)
What did you do?
However the following code panics
package main
import (
"gonum.org/v1/gonum/stat/distuv"
)
func main() {
var d distuv.Laplace
d.Fit([]float64{1}, nil)
}
What did you expect to happen?
Nothing
What actually happened?
panic: distuv: slice length mismatch
What version of Go and Gonum are you using?
go version go1.11.1 darwin/amd64 513db5a0
Does this issue reproduce with the current master?
Yes
What is the intended behavior nil should or should not be accepted. I can submit a patch if required.