David Widmann
David Widmann
Your function is type unstable. Since the type of `m` and `s` changes in the for loop (from `Int` to `Float64` in your example), the type of the returned values...
BTW the two examples above are similarly fast/slow as the implementation of Welford's algorithm in Statistics (unsurprisingly since it's copied from there but still good to know): ```julia julia> @btime...
> I am surprised there is not already a transitive dependency on ChainRulesCore. > But indeed there isn't. It is in StatsBase >= 0.33.11 through LogExpFunctions.
> It feels very strange to have the sum potentially be of a different type than the individual weights themselves, and seems to introduce an extra unnecessary type parameter. Generally,...
> If you normalize the weights to have an unchanged sum, you should be able to mutate the weights in-place. Normalization means that you have to change all weights instead...
No, it can't, you would still have to update the whole array instead of a single entry. There are also good reasons for using integers instead of floats, eg they...
Seems like the PR is mainly missing tests, e.g., with OffsetArrays? (Of course, there are other possible improvements discussed in some comments above but in my opinion they could go...
I am not completely sure, are you mainly interested in my opinion about keyword argument names? I just skimmed through the discussion quickly but I think it mixes up different...
> It seems to me the way to proceed is to introduce a separate weighted quantile regression (per the previous suggestion), and then submit a pull request for Laplace that...
Are indexing operations a common thing for `UnitWeights`? In my experience it's mainly used for dispatching to unweighted implementations, in which cases returning `StaticInt` seems less useful but potentially confusing...