Moving Average

class darts.models.filtering.moving_average_filter.MovingAverageFilter(window, centered=True)[source]

Bases: FilteringModel

A simple moving average filter. Works on deterministic and stochastic series.

Methods

filter(series)

Computes a moving average of this series' values and returns a new TimeSeries.

Parameters
  • window (int) – The length of the window over which to average values

  • centered (bool) – Set the labels at the center of the window. If not set, the averaged values are lagging after the original values.

Methods

filter(series)

Computes a moving average of this series' values and returns a new TimeSeries.

filter(series)[source]

Computes a moving average of this series’ values and returns a new TimeSeries. The returned series has the same length and time axis as series. (Note that this might create border effects).

Parameters

series (TimeSeries) – The a deterministic series to average

Returns

A time series containing the average values

Return type

TimeSeries