Quantcast
Channel: Math.NET Numerics
Viewing all articles
Browse latest Browse all 971

New Post: RunningStatistics: Is there a way to track only a window of the last 5 samples?

$
0
0
I (as an outside observer) can't find anything like this in the code. In principle you could write a Pop() function as long as you have the x value for the item you're removing by undoing what Push does. This doesn't work for the Minimum and Maximum properties of course (I just noticed that the RunningStatistics.Combine method doesn't handle those either even though it could).

Either way, someone would have to keep a rolling queue. If you're just tracking a window of 5 samples, it's actually not expensive at all to just recompute the statistics again with each new value (it's like 20 floating point ops I'd guess compared to maybe 5 to keep a running tally).

Viewing all articles
Browse latest Browse all 971


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>