Opened 11 years ago

Last modified 8 years ago

#6128 new Bugs

rolling_variance addition

Reported by: Pieter Ober <jaapaap@…> Owned by: Eric Niebler
Milestone: To Be Determined Component: accumulator
Version: Boost 1.47.0 Severity: Not Applicable
Keywords: Cc:

Description

LS,

I have just finished writing an implementation and test of a rolling_variance which I would be happy to contribute to the framework.

It includes a redone version of rolling_mean which avoids potential overflow and accuracy issues. The rolling_variance currently returns zero when there are less than 2 samples available.

I'd be happy to do assist to make this fit the accumulator framework better and I include a first draft of the code. Nothing spectacular, but I have not seen the 'rolling' version being published anywhere in the exact form needed, making this non-trivial to implement anyway.

  • Pieter

Attachments (4)

RollingMean.hpp (3.0 KB ) - added by Pieter Ober <jaapaap@…> 11 years ago.
RollingVariance.hpp (4.6 KB ) - added by Pieter Ober <jaapaap@…> 11 years ago.
UnitTestsAccumulators.cpp (2.9 KB ) - added by Pieter Ober <jaapaap@…> 11 years ago.
UnitTestsAccumulators.2.cpp (3.0 KB ) - added by Pieter Ober <jaapaap@…> 11 years ago.
Correct version with all the decimails reported…

Download all attachments as: .zip

Change History (9)

by Pieter Ober <jaapaap@…>, 11 years ago

Attachment: RollingMean.hpp added

by Pieter Ober <jaapaap@…>, 11 years ago

Attachment: RollingVariance.hpp added

by Pieter Ober <jaapaap@…>, 11 years ago

Attachment: UnitTestsAccumulators.cpp added

by Pieter Ober <jaapaap@…>, 11 years ago

Attachment: UnitTestsAccumulators.2.cpp added

Correct version with all the decimails reported...

comment:1 by David Bellot, 10 years ago

in the constructor and in operator(), "args" is not used and sometimes, this generates warnings. One simple solution is to add a void statement like this (the famous UNUSED(x) macro):

(void) args;

in the unit test, it's ok without it but not in more complex code.

comment:2 by anonymous, 9 years ago

Is there any update on this? It would be useful to have rolling variance in Boost Accumulators.

comment:3 by anonymous, 9 years ago

I agree with anonymous.

in reply to:  3 comment:4 by anonymous, 8 years ago

Replying to anonymous:

I agree with anonymous.

Are there any news about the addition of rolling_variance?

comment:5 by Eric Niebler, 8 years ago

It has already been merged to the develop branch. I'm dealing with some test failure. Then I'll merge to release.

Note: See TracTickets for help on using tickets.