Hi Matthias, Thanks for your advice! I now tried to insert the actual pixel values into the accumulator. The median is now calculated (almost) correctly. That's sufficient for my application. Maybe it would be good to extend the documentation by mentioning that the median cannot be estimated well, if the inserted data is sorted? Because most people know how to use the median but not, how to estimate it. (maybe there are more such statistical parameters?). You also mentioned, Accumulators is not the best library for my needs, what would you suggest? Thanks, Max Matthias Troyer schrieb:
Hi Maximilian,
The problem with the median seems to be that you are not using Boost.Accumulator in the intended watt. What you do is that you create a histogram of the distribution, and then you want to use the library to calculate statistical properties from this histogram instead of the original sample values. This however introduces correlations into your samples: they are monotonically increasing.
For values like the mean, variance, skewness, ... this will still work. However, since there is no exact method of calculating the median without storing all values the median is approximated in Boost.Accumulator. That approximation will however be bad if you first sort the data as you essentially do.
The short answer is that Boost.Accumulator is not the right library for getting the median from a histogram, and it is also not the most efficient library for the other quantities in your case.
Matthias
Sent from my iPad