-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch Estimator to use an double exponential time-based weighting
This is an implementation of an exponentially weighted running average with a tuning parameter (currently a constant in this implementation): * the `ews` parameter is a number of seconds. Progress the Estimator has observed that is older than this value will receive a total weight of 0.1 in the rate estimation, and newer values will receive a total of 0.9. The default is 15 seconds. This implementation does double smoothing by applying the running average to itself. The result avoids undesirable instantaneous movements in the estimate when large updates occur. The exponential estimator works by keeping a running tally, where an existing tally that has aged `t` seconds is reweighted such that weight ^ (ewa / age) = 0.1 For instance, data aged 5 seconds with a 15 second weight parameter would receive `weight = 0.1 ^ (5/15) = 0.464`. If it then ages another 10 seconds, it would receive `weight = 0.1 ^ (10/15) = 0.215`. After being multiplied by both weights, it would have a weight of `0.464 * 0.215 = 0.1`, as expected. A couple of basic features are also implemented for higher quality estimates: * We divide out any weight given to data before the estimator was initialized. This is called "normalization" in the code, because it renormalizes the weights in the weighted average to sum to 1. * When returning an estimate, we include the time since the last updated was received as non-progress, which means that the estimator does not freeze when progress stalls.
- Loading branch information
Showing
1 changed file
with
193 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters