I have some code that uses a Boost accumulator to track a mean across a rolling window -- "rolling mean". In addition to the rolling mean, I would like to track the minimum and maximum across this same rolling window.
Is there a way to compute a rolling min and rolling max with a Boost accumulator? I am not seeing a way...
I have tried adding min and max tags to the accumulator used for rolling_mean, but that does not give me what I want.
typedef accumulator_set<uint32_t, stats<tag::rolling_mean> > rollingMeanAcc_t;
becomes
typedef accumulator_set<uint32_t, stats<tag::rolling_mean,tag::min,tag::max> > rollingMeanAcc_t;
However, the min and max provided here are calculated over the entire accumulator, rather than limited to the same rolling window as the mean.
The Boost documentation says that min and max are computed across all samples, not limited to a rolling window. They do not appear to provide a way to restrict or weight the samples.
I would like to be able to report mean/min/max all across a rolling window.
I am currently using Boost version 1.48.0. I have looked at the documentation for the latest version (1.54.0) and do not see a rolling min/max implemented there.
I have found a non-Boost way to track a sliding window minimum, but this does not appear to be what I want either. I don't want to remove values just because they are greater/less than the previous min/max, as that would make the rolling_mean inaccurate.