boostorg / accumulators

An awesome library from Boost
http://boost.org/libs/accumulators
22 stars 54 forks source link

How to implement a new statistical class rolling_weighted_mean? #57

Open JaydenFish opened 1 year ago

JaydenFish commented 1 year ago

It is complexed to mix rolling and weighted. thanks very much.

yuvalif commented 1 year ago

it depends what kind of functionality you want. you can just add a weight that will be stored together with the value and treated similarly to how "weighted_mean" is using the weight (just multiply with the value). another option is to have fixed weights associated with the positions in the window (= a filter), here the implementation is different, but should not be too complex.