Open
Description
julia> using WeightedOnlineStats, StatsBase
julia> x = randn(100);
julia> w = ProbabilityWeights(abs.(randn(length(x))));
julia> o = WeightedAdaptiveHist(4)
WeightedAdaptiveHist: ∑wᵢ=0 | value=(Float64[], Float64[])
julia> fit!(o, x, w)
WeightedAdaptiveHist: ∑wᵢ=80.3545413740818 | value=([-1.64447, -0.845089, 0.504903, 1.44472], [6.63211, 29.7925, 33.3148, 10.6151])
julia> median(o)
ERROR: ArgumentError: The values of the vector of `FrequencyWeights` must be numericallyequal to integers. Use `ProbabilityWeights` or `AnalyticWeights` instead.
Stacktrace:
[1] quantile(v::Vector{Float64}, w::FrequencyWeights{Float64, Float64, Vector{Float64}}, p::Vector{Float64})
@ StatsBase ~/.julia/packages/StatsBase/pJqvO/src/weights.jl:701
[2] quantile
@ ~/.julia/packages/StatsBase/pJqvO/src/weights.jl:759 [inlined]
[3] quantile(o::WeightedAdaptiveHist{Float64, WeightedAdaptiveBins{Float64}}, p::Float64)
@ WeightedOnlineStats ~/.julia/packages/WeightedOnlineStats/zwy6h/src/histogram.jl:256
[4] median(o::WeightedAdaptiveHist{Float64, WeightedAdaptiveBins{Float64}})
@ WeightedOnlineStats ~/.julia/packages/WeightedOnlineStats/zwy6h/src/histogram.jl:13
[5] top-level scope
@ REPL[125]:1
Maybe probability weights instead?
Metadata
Metadata
Assignees
Labels
No labels