I am looking at the boost::accumulator framework, specifically a couple of the rolling_window calculations.
#include <boost/accumulators/accumulators.hpp>
#include <boost/accumulators/statistics/stats.hpp>
#include <boost/accumulators/statistics/rolling_mean.hpp>
accumulator_set<int, stats<tag::rolling_mean> > acc(tag::rolling_window::window_size = 3);
As you see here, I have set the window_size to be three, such that it is maintaining the mean average of the last three samples only.
Can I amend that size at run-time, perhaps based on a user setting?
If so, and I increase the window_size does the accumulator have extra internal state if it had already seen more than my new window_size, or would I have to wait for the extra values?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…