【发布时间】:2011-07-08 22:25:57
【问题描述】:
我正在研究 boost::accumulator 框架,特别是一些 rolling_window 计算。
#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);
正如您在此处看到的,我已将 window_size 设置为 3,因此它仅保持最后三个样本的平均平均值。
我可以在运行时修改该大小吗,也许基于用户设置?
如果是这样,并且我增加了 window_size,如果累加器已经看到比我的新 window_size 更多的值,它是否有额外的内部状态,还是我必须等待额外的值?
【问题讨论】: