And you could add the split logic to calculating the mean of the means. Just as insurance.
So would that work?
91–96 of 96 posts
And you could add the split logic to calculating the mean of the means. Just as insurance.
So would that work?
Earlier quoted context omitted.
A solution more accurate than sorting before adding is to place your numbers into a priority queue and repeatedly add the smallest two numbers and re-insert the result into the queue. This helps handle the case where you have many similarly valued numbers and your running sum becomes large enough relative to your numbers to cause the same rounding errors.
Isn't a priority queue implicitly sorted?
The priority queue approach boils down to "sort after every addition, instead of just once at the beginning".
If you're reaching these values then it's extremely likely that either: (a) You're doing something wrong (usually, not standardizing your data, etc.) which means that you're not thinking about the fact that computers have finite numerical precision and adjusting your problem accordingly (e.g., have a wide dynamic range of numbers). Or, (b) your problem is pretty ill-conditioned and there's probably no solving it in a…
Earlier quoted context omitted.
Isn't a priority queue implicitly sorted?
Yes. I don't think your parent post meant to imply otherwise. The priority queue approach boils down to "sort after every addition, instead of just once at the beginning".
Here is a fascinating post by Stefan Karpinski, one of the creators of Julia: https://discourse.julialang.org/t/array-ordering-and-naive-s... He shows off a function named "sumsto" which takes a single positive double precision floating point number "x" as an argument. "sumsto" always returns the same vector of 2046 floating point numbers -- just in an order so that naive left-to-right summation returns "x". Just cha…
Here is a fascinating post by Stefan Karpinski, one of the creators of Julia: https://discourse.julialang.org/t/array-ordering-and-naive-s... He shows off a function named "sumsto" which takes a single positive double precision floating point number "x" as an argument. "sumsto" always returns the same vector of 2046 floating point numbers -- just in an order so that naive left-to-right summation returns "x". Just cha…
You think that's bad? Theoretical math has "conditionally convergent series'" [1] Sum in order and it can convergence to a given value. Rearrange the terms and any real number is possible. I have a hunch there could be a bit of relation between these things. [1] https://en.wikipedia.org/wiki/Conditional_convergence
https://arxiv.org/abs/1505.05571
Fortunately pairwise summation (Julia's default) is fast and fairly hard to trip up, although it certainly is possible to trick it.