New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wtih constant data fit(Histogram)
sometimes gives a wrong result
#804
Comments
data = [0.9999...,0.9999...]
, fit(Histogram)
gives a wrong resultfit(Histogram)
sometimes gives a wrong result
The issue is fixed on the master branch, probably by #792: julia> ] add StatsBase#master
julia> using StatsBase
julia> d=zeros(5)
5-element Vector{Float64}:
0.0
0.0
0.0
0.0
0.0
julia> StatsBase.fit(Histogram,d)
Histogram{Int64, 1, Tuple{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}}
edges:
0.0:1.0:1.0
weights: [5]
closed: left
isdensity: false
julia> d.+=0.1
5-element Vector{Float64}:
0.1
0.1
0.1
0.1
0.1
julia> StatsBase.fit(Histogram,d)
Histogram{Int64, 1, Tuple{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}}}
edges:
0.1:1.0:1.1
weights: [5]
closed: left
isdensity: false |
A new release should be available quite soon: #803 |
@devmotion thanks for the quick answer and sorry for not being aware of #803. |
Should I close the issue? |
That depends on you 🙂 I think it's OK to keep it open until a new release is available. But if you think your problem is addressed sufficiently since it is fixed on the master branch, feel free to close it. |
As the problem is fixed I will close it. Thanks |
In some circumstances,
fit(Histogram)
gives a wrong result.An example that gives the expected result : weight = 5 in [0,1)
however, with another constant data value the result makes no sense (to me) : weight = 0 in [1.1, 3.1)
My Julia version :
The text was updated successfully, but these errors were encountered: