double_ewma()
double_ewma applies double exponential moving average (EWMA)
smoothing to the input stream during a specified time window or based on
smoothing parameters. Double EWMA addresses smoothing problems that
occur when the raw data exhibits a trend.
To learn more about double exponential smoothing, do a web search for the term "double exponential smoothing".
Syntax (two durations)
double_ewma(over=level_duration, trend_over=trend_duration [,forecast=forecast_duration][,damping=damp_parameter])
Parameter definitions
Parameter | Type | Description |
|---|---|---|
over | Duration (number plus 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. | Required: Duration over which the method should calculate the level term of the double exponentially weighted moving average of each time series. |
trend__over | Duration (number plus 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. | Required: Duration over which to calculate the trend term of each double exponentially weighted moving average of each time series. |
forecast | Duration (number plus units indicator) Durations are specified as a number followed by a single character: s: seconds m: minutes h: hours d: days The default is 0. | Optional: Future duration to use as the forecast |
damping | Decimal,0.0 ≤ damping ≤ 1.0Default is 1.0 | Optional: Double EWMA damping parameter. |
Syntax (single duration)
double_ewma(over=level_duration[, forecast=forecast_duration][, damping=damp_parameter])
Parameter definitions
Parameter | Type | Description |
|---|---|---|
over | Duration (number plus 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. | Required: Duration over which the method should calculate the level and trend terms of the double exponentially weighted moving average of each time series. |
forecast | Duration (number plus units indicator) Durations are specified as a number followed by a single character: s: seconds m: minutes h: hours d: days The default is 0 | Optional: Future duration to use as the forecast. Default is 0. |
damping | Decimal,0.0 ≤ damping ≤ 1.0 Default is 1.0 | Optional: Double EWMA damping parameter. |
Syntax (two smoothing parameters)
double_ewma(alpha, beta[, forecast=forecast_duration][, damping=damp_parameter])
Parameter definitions
Parameter | Type | Description |
|---|---|---|
alpha | Decimal, 0.0 ≤ alpha ≤ 1.0 | Required: Smoothing parameter of the double EWMA level term |
beta | Decimal, 0.0 ≤ beta ≤ 1.0 | Required: Smoothing parameter of the double EWMA trend term. beta must be greater than or equal to alpha. |
forecast | Duration (number plus units indicator) Durations are specified as a number followed by a single character: s: seconds m: minutes h: hours d: days The default is 0 | Optional: Future duration to use as the double EWMA forecast. |
damping | Decimal,0.0 ≤ damping ≤ 1.0Default is 1.0 | Optional: Double EWMA damping parameter. |
Syntax (single smoothing parameter)
double_ewma(alpha[, forecast=forecast_duration][, damping=damp_parameter])
Parameter definitions
Parameter | Type | Description |
|---|---|---|
alpha | decimal between 0 and 1 | Required: Smoothing parameter of the level and trend terms |
forecast | Duration (number plus units indicator) Durations are specified as a number followed by a single character: s: seconds m: minutes h: hours d: days The default is 0 | Optional: Future duration to use as the forecast |
damping | Decimal,0.0 ≤ damping ≤ 1.0Default is 1.0 | Optional: Double EWMA damping parameter. |
Returns a stream.
Notes
Double exponential smoothing applies to a moving window. The degree of smoothing is expressed in terms of either durations or smoothing parameters. You must use one of the four forms of the method, as specified in the previous sections:
- Level duration, separate trend duration (
over,trend_over) - Duration for level and trend (
over) - Level smoothing, trend smoothing (
alpha,beta) - Level and trend smoothing based on one term (
alpha)
One versus two durations or smoothing parameters is a matter of
convenience: double_ewma(over='5m') is equivalent to
double_ewma(over='5m', trend_over='5m'), and double_ewma(0.8) is
equivalent to double_ewma(0.8, 0.8).
If you provide a duration, SignalFlow may do the calculation on rolled-up data. Long durations in particular may affect the resolution that the calculation job uses.
If you provide a smoothing parameter, SignalFlow performs the calculation at the resolution of the input stream. In particular, a smoothing parameter doesn’t influence the job resolution. Smoothing parameters that are closer to zero provide more smoothing. The number of slots in the smoothing window is determined by the smoothing parameter (closer to zero means more slots).
This method can’t be used to aggregate time series.
Examples
A = data('jvm.cpu.load')A.double_ewma(0.1).publish()A.double_ewma(over='20m', trend_over='18m').publish()A.double_ewma(0.1, 0.2, forecast='5m', damping=0.9).publish()