Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: class ExponentialMovingAverage
Note: This documentation is automatically generated.
Manages exponential moving averages defined as
new_average = decaying_factor * old_average
+ (1 - decaying_factor) * new_record.
where 0 < decaying_factor < 1.
Method |
AddData | Return type: void Arguments: double new_record |
CurrentAverage | Return type: double Returns exponential moving average for all the added data so far.
|
ExponentialMovingAverage | Return type: explicit Arguments: double decaying_factor |
NumRecords | Return type: int64_t Returns the total number of added records so far.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-08-06 UTC.
[null,null,["Last updated 2024-08-06 UTC."],[],["The `ExponentialMovingAverage` class in C++ calculates moving averages using a decaying factor. It offers methods to `AddData` (a new record), retrieve the `CurrentAverage`, and query the `NumRecords` (total data points added). The constructor `ExponentialMovingAverage` takes a `decaying_factor` (between 0 and 1) as input. The moving average is updated as `new_average = decaying_factor * old_average + (1 - decaying_factor) * new_record`.\n"],null,[]]