|
Boost Users : |
Subject: Re: [Boost-users] [accumulators] Moving mean expiry
From: Michael Powell (mwpowellhtx_at_[hidden])
Date: 2013-09-07 23:54:24
On Sat, Sep 7, 2013 at 9:35 PM, Michael Powell <mwpowellhtx_at_[hidden]> wrote:
> Hello,
>
> I am looking for a moving window mean accumulator. Could roll my own,
> but I know there's a pretty good one in Boost. Need to know, does it
> comprehend the notion of Expiration? That is, values dropping off
> after a predetermined window of time? Preferably depending on the
> boost::chrono::high_resolution_clock.
Digging into the domain a bit further, perhaps Expiry is unnnecessary.
What I really want, I think, is a rolling weighted mean. So to do
that, something like the following:
#include <boost/accumulators/accumulators.hpp>
#include <boost/accumulators/statistics/rolling_mean.hpp>
#include <boost/accumulators/statistics/weighted_mean.hpp>
//For convenience:
namespace boost {
namespace accumulators {
typedef accumulator_set<float, stats<tag::rolling_mean>,
features<stag:weighted_mean> > acc_type;
}} //namespace boost::accumulators
Which should allow me to query the accumulator for rolling_mean over
the last however many samples?
> Thank ye...
>
> Regards,
>
> Michael Powell
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net