Questions tagged [boost-accumulators]

Boost.Accumulators is both a library for incremental statistical computation as well as an extensible framework for incremental calculation in general.

Boost.Accumulators is both a library for incremental statistical computation as well as an extensible framework for incremental calculation in general. The library deals primarily with the concept of an accumulator, which is a primitive computational entity that accepts data one sample at a time and maintains some internal state. These accumulators may offload some of their computations on other accumulators, on which they depend. Accumulators are grouped within an accumulator set. Boost.Accumulators resolves the inter-dependencies between accumulators in a set and ensures that accumulators are processed in the proper order.

34 questions
12
votes
2 answers

Summing two boost::accumulator_set instances

I have recently discovered the excellent library boost::accumulators, and I would like to use it to replace some of my code that accumulates statistics. One thing I cannot find in the documentation is the ability to sum two accumulator sets, as in…
killogre
  • 1,730
  • 15
  • 26
6
votes
1 answer

boost::accumulators::rolling_mean returning incorrect mean value

Environment: VS 2013, Boost 1.58 I've written something that presents a more friendly interface to Boost's accumulator, which can be used to project a sum over a window, and calculate the actual rolling mean over the window. During a push to get to…
iamtheddrman
  • 623
  • 5
  • 16
6
votes
2 answers

rolling min and rolling max for C++ boost?

I have some code that uses a Boost accumulator to track a mean across a rolling window -- "rolling mean". In addition to the rolling mean, I would like to track the minimum and maximum across this same rolling window. Is there a way to compute a…
tony_tiger
  • 789
  • 1
  • 11
  • 25
5
votes
1 answer

Can boost accumulators be used as class members

I'm trying to use a boost accumulator to calculate a rolling mean. When I declare the variable inline like this: #include #include #include #include…
Zefira
  • 4,329
  • 3
  • 25
  • 31
4
votes
0 answers

How does the mean tag affect the boost variance accumulator?

Including the mean tag returns an incorrect variance. I have tried this with both weighted and straight variances with similar results. I have included my code below. Am I doing something wrong? Sample output: ./stats 1 2 3 4 5 6 Variances: …
Colm
  • 41
  • 3
3
votes
1 answer

Using empty boost::accumulators

How to check an empty boost::accumulators acc or not? For example: if (acc.isEmpty())//I don't know what function here return 0; else return boost::accumulators::mean(acc). Because if it's empty, i get NaN for boost::accumulators::mean(acc).
ekaterina
  • 33
  • 2
3
votes
0 answers

boost::accumulator: std::vector does not work with rolling_mean

I'm following some thread (this, this and this) in order to calculate the rolling mean using std::vector as sample. I've included headers of numeric::functional sublibrary in order to work with vectors This code does not compile #include…
Jepessen
  • 11,744
  • 14
  • 82
  • 149
2
votes
2 answers

Using empty Boost accumulators

I am curious, what average is obtained from this code snippet? The accumulator is intended to be empty. boost::accumulators::accumulator_set< int, boost::accumulators::features > Accumulator; int Mean =…
Dylan Klomparens
  • 2,853
  • 7
  • 35
  • 52
2
votes
0 answers

Sliding window median in C++

I need some sliding window statistics and I am considering to use boost::accumulators for that, however, I couldn't find the sliding window median algorithm there. Does boost::accumulators provide an exact and deterministic sliding window median…
Vahagn
  • 4,670
  • 9
  • 43
  • 72
2
votes
2 answers

Why do the accumulators from the C++ boost library have a function-like interface?

In the boost library, we use accumulators like this: acc(1); // push things into acc cout << max( acc ) << endl; // get its result Why can't we define its interface like this: acc.push(1); cout << acc.max() << endl; So why do the accumulators from…
Home3
  • 131
  • 6
2
votes
1 answer

What is the advantage of droppable accumulator in boost library in c++?

I've recently read the User's Guide of Boost.Accumulator There is a chapter named "Droppable Accumulators" which illustrates how to use "accumulators that can be removed from the accumulator_set<>". The whole section was talking about how it might…
Home3
  • 131
  • 6
2
votes
2 answers

reset boost accumulator c++

Having not found a 'boost' way of resetting an accumulator in C++, I came across a piece of code that seems to reset a boost accumulator. But don't understand how it is achieving it. The code is as below - #include #include…
badri
  • 575
  • 2
  • 8
  • 22
1
vote
1 answer

Boost skewness c++ example

Any one have an example of using the boost skewness and weighted skewness accumulators? All I found was the source code, and any examples of using this would be great. any one know how to get these to work for matrices?
pyCthon
  • 11,746
  • 20
  • 73
  • 135
1
vote
1 answer

How can I use boost accumulator quantile_probability inside a class member initialization?

Boost Accumulator has an unfortunate quirk in which the api interface behaves differently when used inside of a class. I am trying to use Boost Accumulator quantile_probability inside of a class but I can't figure out how to make it work. This…
Nathan Doromal
  • 3,437
  • 2
  • 24
  • 25
1
vote
1 answer

How do I use/access a user argument in a boost accumulator?

I have the gist of a custom accumulator. I want to know how to get an integer argument from the "argument pack", or if this is even possible: namespace boost { namespace accumulators { namespace impl { template struct…
Matt Chambers
  • 2,229
  • 1
  • 25
  • 43
1
2 3