Fourier Moving Average (Fourier MA) Model

Econometrics
Introduced by
Harvey, A. C.; Hyndman, R. J.
Year
1990s–2000s
Type
Time series model
Family
Econometrics / time series

What does it do?

The Fourier MA model combines a moving average (MA) error structure with Fourier series terms, sine and cosine pairs, to represent smooth seasonal patterns in regularly spaced time series.

It is mainly useful when the seasonal period is long, because seasonal ARIMA would then need seasonal AR or MA terms at a very high lag, which quickly becomes impractical.

The intuition behind the method

Consider a series with a repeating seasonal cycle, such as daily demand observed over a long annual period. A plain MA model handles short-range random shocks but has no way to represent a smooth cycle. Fourier terms add sine and cosine waves at chosen harmonics of the seasonal period. A truncated set of harmonics approximates a smooth periodic shape with a small number of coefficients, and the MA component then models the short-run correlation left in the residuals around that shape.

History

Harvey (1993) discusses trigonometric seasonal components within structural time series and state-space models. Hyndman and Athanasopoulos (2021) describe Fourier terms combined with ARIMA-type errors, which they term dynamic harmonic regression, for long seasonal periods. The label 'Fourier MA model' is descriptive; neither source establishes a single originator for it.

When to use it

Use the Fourier MA model when the series is regularly spaced and has a long seasonal period m, which makes seasonal ARIMA impractical, and when the residuals still show short-run autocorrelation that an MA component can capture. It suits univariate series that are stationary, or that have been differenced or detrended to stationarity, with smooth repeating seasonal shapes. Avoid it when the seasonal pattern changes substantially over time, since the coefficients are fixed across the sample; approaches such as TBATS are better suited to that case. Also avoid it for series with a unit root or drift that has not been removed, and for samples that are short relative to the seasonal period, where the harmonic coefficients cannot be estimated reliably.

Limitations and considerations

  • The coefficients α_k and β_k are constant over the sample, so the model does not capture a seasonal shape that drifts or changes over time.
  • Choosing K and q needs careful comparison of candidate models, because too many harmonics or too high an MA order overfits the sample.
  • The MA error is always stationary, but the observed series must be stationary apart from the deterministic Fourier seasonal component. A series with a unit root or stochastic trend must be differenced or detrended first, since the Fourier terms do not remove drift.
  • Performance can degrade when several overlapping seasonal cycles interact, since each additional Fourier set adds parameters and the seasonal shape must be specified in advance.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Handles long seasonal periods, such as the m = 365 or m = 52 cases mentioned on this page, where seasonal ARIMA would need very high-order seasonal terms.
  • Parsimonious: a small number of Fourier harmonics K can represent a smooth seasonal shape with few parameters.
  • Separates a deterministic seasonal component from a stochastic MA error, so the two parts can be inspected separately.
  • Each harmonic k contributes a sinusoid whose amplitude is the square root of α_k² + β_k² and whose timing depends on both coefficients, which makes the fitted seasonal shape easy to read.
  • Fourier terms can be added as regressors to other frameworks, such as ARIMA or regression models, when the same long-period seasonality must be handled there.

Applications

  • Forecasting electricity demand with intra-day and intra-week seasonal cycles.
  • Modelling retail sales with annual and holiday-related seasonal patterns over a long period.
  • Analysing environmental data with long periodic structures, such as annual temperature cycles.
  • Modelling traffic and transport flow data with several overlapping seasonal frequencies.

How it works

How it works

1

A set of K sine-cosine pairs is constructed for the seasonal period m. Each pair represents one harmonic of the cycle, and the coefficients α_k and β_k set its size and timing. The analyst chooses K: more harmonics can reproduce sharper seasonal shapes, but too many risk overfitting. These terms enter as fixed regressors in the model.

Formula
s_t = \sum_{k=1}^{K} \left[ \alpha_k \sin\!\left(\frac{2\pi k t}{m}\right) + \beta_k \cos\!\left(\frac{2\pi k t}{m}\right) \right]
2

The error left after the level and the Fourier seasonal component is modelled as a moving average process of order q. The current error is a weighted sum of the current white-noise innovation and the q previous innovations, which captures short-run autocorrelation in the shocks.

Formula
\varepsilon_t = \theta_1 u_{t-1} + \cdots + \theta_q u_{t-q} + u_t
3

The observed value y_t equals a baseline level μ plus the Fourier seasonal component s_t plus the MA error ε_t. This additive structure separates the deterministic seasonal signal from the short-run stochastic dynamics.

Formula
y_t = \mu + s_t + \varepsilon_t
4

The model can be written as a regression with MA errors: y_t = μ + x_t^T γ + ε_t, where x_t stacks the sine and cosine terms, γ collects the coefficients α_k and β_k, and ε_t follows an MA(q) process. The mean, the Fourier coefficients and the MA weights θ_1 to θ_q are estimated jointly, typically by maximum likelihood, with conditional least squares as a common alternative. Because the MA weights enter the error structure nonlinearly, the optimiser may converge slowly, stop at a local solution, or return MA weights that are not invertible, so convergence and invertibility should be checked after fitting. Information criteria such as AIC or BIC are used to compare candidate values of K and q.

Common pitfalls

  • Choosing K close to m/2 fits the seasonal pattern very closely in sample, inflates the in-sample fit, and can worsen out-of-sample forecasts.
  • Fitting the model to an undifferenced, trending or unit-root series, which the stationary MA error cannot represent.
  • Ignoring the autocorrelation of the residuals (ACF and PACF) after fitting. Remaining autocorrelation suggests that q is too low or that another dynamic term is missing.
  • Using the model on a series with sudden seasonal breaks or structural shifts without adding intervention terms, so the fixed harmonics are fitted to two different regimes.

Frequently asked questions

How do I choose the number of Fourier harmonics K?

Fit models with K = 1, 2, … up to floor(m/2) and select K using AIC or BIC on the training sample. Then confirm the choice with out-of-sample evaluation on a hold-out window, because in-sample criteria do not guarantee better forecasts.

What is the difference between a Fourier MA and a seasonal ARIMA model?

Seasonal ARIMA uses seasonal lag operators and requires that the seasonal period m be an integer small enough to estimate seasonal AR/MA polynomials directly. This is feasible for m = 4 or 12 but impractical for m = 52 or 365. The Fourier MA model replaces the seasonal AR/MA operators with a few trigonometric regressors, which keeps the parameter count manageable for large m.

Can the Fourier MA model handle multiple seasonal periods?

Yes. You can include two sets of Fourier terms, one for each seasonal period (for example, weekly and annual cycles in daily data), together with the MA error structure. Each added set adds parameters, so the choice of harmonics for each period should be checked separately.

Does the series need to be stationary before fitting?

The MA error is stationary by construction, but the observed series must be stationary apart from the deterministic Fourier seasonal component. A series with a unit root or stochastic trend should be differenced or detrended before fitting, because Fourier terms capture periodic patterns but not systematic drift.

How do I diagnose a good fit?

Examine the ACF and PACF of the fitted model's residuals, not the raw series, for remaining autocorrelation. Apply the Ljung-Box test to these residuals with a lag chosen relative to the seasonal period (about 2m is a common choice for seasonal data, and the lag cannot exceed what the sample allows), and adjust the degrees of freedom for the number of estimated parameters. A small p-value indicates remaining autocorrelation, which suggests raising q or K or adding another dynamic term. Also compare AIC and BIC across candidate K and q values, and evaluate out-of-sample forecast accuracy (MAPE, RMSE) on a hold-out window.

Related methods

Sources

  1. Hyndman, R. J., & Athanasopoulos, G. (2021). Forecasting: Principles and Practice (3rd ed.). OTexts.

    Open publication reference
  2. Harvey, A. C. (1993). Time Series Models (2nd ed.). MIT Press.

    ISBN: 978-0262082242