MovingAverage

open class MovingAverage

Calculates an exponentially weighted moving average for a series of data.

Constructors

Link copied to clipboard
constructor(initialSample: Double)
Construct an object to track the exponentially weighted moving average for a series of data.
constructor(initialSample: Double, weight: Double)
Construct an object to track the exponentially weighted moving average for a series of data.

Properties

Link copied to clipboard
open val average: Double
Link copied to clipboard
val DEFAULT_WEIGHT: Double = 0.8999999761581421

Functions

Link copied to clipboard
open fun addSample(sample: Double)
Add a sample and calculate a new average.