JuliaStats / KernelDensity.jl

Kernel density estimators for Julia
Other
175 stars 40 forks source link

bug in kde_range #39

Closed OmriTreidel closed 6 years ago

OmriTreidel commented 7 years ago

There seem to be a problem with kde_range in univariant.jl: The range that is returned sometimes has the wrong number of points.

Can be easily detected by inserting length(lo:step:hi) == npoints || @show "ERROR", length(lo:step:hi) before returning.

I think it results from a problem is linspace.

Suggested fix:

return lo + (0:npoints-1)*step instead of lo:step:hi