Class: shaka.abr.Ewma

This class computes an exponentionally-weighted moving average.

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:

estimate_ :number

Type:
  • number
Source:

totalWeight_ :number

Type:
  • number
Source:

Methods

getEstimate() → {number}

Source:
Returns:
Type
number

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: