Exponential Weighting with Trend and Seasonality

Overview

The EWMA with trend algorithm has been extended to include a seasonality component. In this case, there is a level {% a_t %}, a trend {% b_t %} and a seasonality {% s_t %}. The seasonality is a multiplicative factor. When set to one, it has no effect. (see forecast below)

Updates

There are three learning rates {% \alpha %}, {% \beta %} and {% \gamma %}. {% \phi %} is the trend damping factor.
{% a_t = \alpha \times x_t / s_{t-p} + (1-\alpha)(a_{t-1} + \phi b_{t-1}) %}
{% b_t = \beta (a_t - a_{t-1}) + (1-\beta) \phi b_{t-1} %}
{% s_t = \gamma \times x_t / a_t + (1-\gamma)s_{t-p} %}

Forecast

{% f_{t+1} = (a_t + \phi b_t) s_{t+1-p} %}

Exponentially Weighted Moving Average API

The exponentially weighted moving average with trend and seasonality is implemented in the EWMA Library