Closed axsk closed 8 years ago
I wonder what would be the best way to include this option without allocationg a whole fill(1/ndata, ndata)
in the default case of even weights.
@axsk I've also often wondered the same. In GLM.jl (https://github.com/JuliaStats/GLM.jl/blob/master/src/lm.jl) this is handled by allowing weights to be of length zero and then having two special cases (via isempty(wts)
) in the individual functions. See also the discussion at https://github.com/JuliaStats/StatsBase.jl/issues/135.
c.f. #26
I need to do a KDE over weighted data, i.e. each entry of
data::RealVector
should count according toweights::RealVector
withsum(weights) == 1
Am I right thinking that all I need to adjust is
ainc = 1.0 / (ndata*s*s)
->ainc = 1.0 / (s*s)
andin univariate.jl?