# Moving-average model

In time series analysis, the moving-average (MA) model is a common approach for modeling univariate time series. The notation MA(q) refers to the moving average model of order q:

$X_t = \mu + \varepsilon_t + \theta_1 \varepsilon_{t-1} + \cdots + \theta_q \varepsilon_{t-q} \,$

where μ is the mean of the series, the θ1, ..., θq are the parameters of the model and the εt, εt−1,..., εt−q are white noise error terms. The value of q is called the order of the MA model. This can be equivalently written in terms of the backshift operator B as

$X_t = \mu + (1 + \theta_1 B + \cdots + \theta_q B^q)\varepsilon_t.$

Thus, a moving-average model is conceptually a linear regression of the current value of the series against current and previous (unobserved) white noise error terms or random shocks. The random shocks at each point are assumed to be mutually independent and to come from the same distribution, typically a normal distribution, with location at zero and constant scale.

## Interpretation

The moving-average model is essentially a finite impulse response filter applied to white noise, with some additional interpretation placed on it. The role of the random shocks in the MA model differs from their role in the autoregressive (AR) model in two ways. First, they are propagated to future values of the time series directly: for example, $\varepsilon _{t-1}$ appears directly on the right side of the equation for $X_t$. In contrast, in an AR model $\varepsilon _{t-1}$ does not appear on the right side of the $X_t$ equation, but it does appear on the right side of the $X_{t-1}$ equation, and $X_{t-1}$ appears on the right side of the $X_t$ equation, giving only an indirect effect of $\varepsilon_{t-1}$ on $X_t$. Second, in the MA model a shock affects $X$ values only for the current period and q periods into the future; in contrast, in the AR model a shock affects $X$ values infinitely far into the future, because $\varepsilon _t$ affects $X_t$, which affects $X_{t+1}$, which affects $X_{t+2}$, and so on forever.

## Deciding appropriateness of the MA model

Sometimes the autocorrelation function (ACF) and partial autocorrelation function (PACF) will suggest that an MA model would be a better model choice and sometimes both AR and MA terms should be used in the same model (see Box-Jenkins#Identify p and q).

## Fitting the model

Fitting the MA estimates is more complicated than with autoregressive models (AR models) because the lagged error terms are not observable. This means that iterative non-linear fitting procedures need to be used in place of linear least squares.

### Choosing the order q

The autocorrelation function of an MA(q) process becomes zero at lag q + 1 and greater, so we determine the appropriate maximum lag for the estimation by examining the sample autocorrelation function to see where it becomes insignificantly different from zero for all lags beyond a certain lag, which is designated as the maximum lag q.