Class: SimpleMovingAverage
A utitlity class for calculating a numerical average of a selected number of samples.
Constructors
constructor
• new SimpleMovingAverage(samples
): SimpleMovingAverage
Class to return a numerical average from a specified number of inputs.
Parameters
Name | Type | Description |
---|---|---|
samples | number | is the number of samples. |
Returns
Defined in
src/sdk/math/SimpleMovingAverage.ts:11
Methods
getAverage
▸ getAverage(input
): number
Returns a numerical average of the inputs.
Parameters
Name | Type | Description |
---|---|---|
input | number | is the input number. |
Returns
number
The numerical average.
Defined in
src/sdk/math/SimpleMovingAverage.ts:18
reset
▸ reset(): void
Resets the average.
Returns
void
Defined in
src/sdk/math/SimpleMovingAverage.ts:33