SignalFx Developers Guide

ewma()

The ewma method calculates the exponentially weighted moving average (EWMA) of the stream during the specified time duration, or based on a smoothing parameter. The Wikipedia article on Moving average contains a section that describes Exponential moving average.

Syntax (time duration)

ewma([over=duration])

Table 1. Parameter definitions
Parameter Type Description

duration

Duration (number and duration units indicator)
Durations are specified as a number followed by a single character:

  • s: seconds

  • m: minutes

  • h: hours

  • d: days

The default is None.

Optional: The duration over which to calculate the exponential weighted average for the input timeseries

Syntax (smoothing parameter)

ewma(alpha)

Table 2. Parameter definitions
Parameter Type Description

alpha

Decimal, 0.0 ≤ damping ≤ 1.0. Default is 0.0

Optional: The smoothing parameter used to calculate the exponential weighted average of each input timeseries

Both forms return a reference to the input stream object.

Notes

The function calculates the exponential weighted average for a rolling time duration.

If you specify a duration, the function may do the calculation on on rolled-up data. In particular, long durations may alter the job resolution.

If you specify a smoothing parameter, the function always does the calculation at the resolution of the input stream. In particular, a smoothing parameter doesn’t alter the job resolution. Smoothing values closer to zero specify more smoothing. The smoothing parameter determines the number of slots in the smoothing window; a value closer to zero produces more slots.

Smoothing values that approach one asymptotically have little effect on the input stream. Conversely, smoothing values that approach zero asymptotically produce streams that lag behind the input. You should start with a smoothing value of 0.1 to look at initial results.

You can’t use this method to aggregate time series.

Examples

1
2
3
A = data('jvm.cpu.load')
A.ewma(0.1).publish()
A.ewma(over='20m').publish()

© Copyright 2019 SignalFx.

Third-party license information