Constructor
new Ewma(halfLife)
This class computes an exponentionally-weighted moving average.
Parameters:
Name | Type | Description |
---|---|---|
halfLife |
number | The quantity of prior samples (by weight) used when creating a new estimate. Those prior samples make up half of the new estimate. |
- Source:
Members
alpha_ :number
Larger values of alpha expire historical data more slowly.
Type:
- number
- Source:
Methods
sample(weight, value)
Takes a sample.
Parameters:
Name | Type | Description |
---|---|---|
weight |
number | |
value |
number |
- Source:
updateAlpha(halfLife)
Update the alpha with a new halfLife value.
Parameters:
Name | Type | Description |
---|---|---|
halfLife |
number | The quantity of prior samples (by weight) used when creating a new estimate. Those prior samples make up half of the new estimate. |
- Source: