libstatistics_collector icon indicating copy to clipboard operation
libstatistics_collector copied to clipboard

Enable setting window size for MovingAverageStatistics

Open tonynajjar opened this issue 10 months ago • 3 comments
trafficstars

Description

The MovingAverageStatistics should allow passing a window_size for the calculation of the moving average

tonynajjar avatar Jan 07 '25 12:01 tonynajjar

I also think this feature is essential. In the first place, although it is called a moving average, it is actually calculating the overall average, which does not align with the class name. Just to confirm, the original intention of the implementation was to have MovingAverageStatistics calculate a moving average, correct?

Tacha-S avatar Feb 19 '25 01:02 Tacha-S

Or was it simply intended to calculate an online average for the sequentially obtained data?

Tacha-S avatar Feb 19 '25 01:02 Tacha-S

Looking at the implementation, it looks like it was definitely intended to cover all the data, even though it mentions "moving average."

However, changing it to be able to consider a real window (i.e., only the last X values) makes sense to me. PRs are welcome.

christophebedard avatar Feb 19 '25 16:02 christophebedard