ExponentialMovingAverage

class lib.gui.analysis.moving_average.ExponentialMovingAverage(data: ndarray, amount: float)

Bases: object

Reshapes data before calculating exponential moving average, then iterates once over the rows to calculate the offset without precision issues.

Parameters:
  • data (numpy.ndarray) – A 1 dimensional numpy array to obtain smoothed data for

  • amount (float) – in the range (0.0, 1.0) The alpha parameter (smoothing amount) for the moving average.

Notes

Adapted from: https://stackoverflow.com/questions/42869495

Methods Summary

__call__()

Perform the exponential moving average calculation.

Methods Documentation

__call__() ndarray

Perform the exponential moving average calculation.

Returns:

The smoothed data

Return type:

numpy.ndarray

__call__() ndarray

Perform the exponential moving average calculation.

Returns:

The smoothed data

Return type:

numpy.ndarray