**Have a Question?**

**Phone:** +1 (888) 427-9486

+1 (312) 257-3777

Contact Us

# Technical Note: Moving Average Model

Attachment | Size | |
---|---|---|

TN-MA.pdf |

Occasionally, we receive requests for a technical issue about ARMA^{i} modeling beyond our regular NumXL support, which delves more into the mathematical formulation of ARMA. We are always happy to help our users with any question they may have, so we decided to share our internal technical notes with you.

These notes were originally composed when we sat in on a time series analysis class. Over the years, we’ve maintained these notes with new insights, empirical observations and intuitions acquired. We often go back to these notes for resolving development issues and/or to properly address a product support matter.

In this paper, we’ll go over a simple, yet fundamental, econometric model: moving average. This model serves as a cornerstone for all serious discussion on ARMA/ARIMA^{i} models.

## Background

A moving average model of order q (i.e. MA(q)) is defined as follows:

Where

- is the innovations or shocks for our process
- is the conditional standard deviation (aka volatility)

The output value () is solely determined by a long run average ( ) and a weighted sum of past shocks or innovations ().

## Stability

By definition, the MA process is stable and has a finite long-run mean () and variance:

- The unconditional (i.e. long-run) mean is simply

- The unconditional (i.e. long run) variance is defined as follows:

- For a finite order q, the process is guaranteed to be stable (i.e. does not converge to infinity).
- For an infinite order (i.e. ), the process is stable only if the long-run variance is finite:

In other words, the sum of the squared values of the MA coefficients is finite.

## Forecast

Given an input sample data , we can calculate values of the moving average process for future (i.e. out-of-sample) values as follows:

The variance (squared standard error) of the out-of-sample values is expressed as follows:

Note: The conditional variance grows cumulatively over q-steps to reach its long-run (unconditional) variance.

## Stationarity

By definition, a weak-sense stationary (weak stationary) process requires the first moment (i.e. mean) and covariance do not vary with respect to time.

For the first moment, the conditional mean is obviously time-invariant:

For the second moment (i.e. variance and auto-covariance), let’s examine this assumption. By definition, the auto-covariance for lag^{i} order j is expressed as follows:

The auto-covariance of lag order zero () is the same as the unconditional variance:

To examine for variability with respect to time, it is sufficient to examine the following:

Using either definition, we can easily show that the auto-covariance function does not vary with respect to time (t), but is rather determined solely by the lag order j. In sum, the moving average process is a weak-sense stationary process.

## Correlogram

What do the moving average correlogram plots look like? Can we identify a moving average process (and its order) from correlogram plots (i.e. ACF and PACF^{i})?

The auto-correlation function (ACF) is defined as the ratio of auto-covariance and unconditional variance:

By definition; and the next q ACF:

What does this mean? If the ACF plot exhibits significant values for the first j-lags and then drops to zero, we can probably model the process with a moving average model of order j.

Using only the ACF plot, I should be able to construct an MA model for any process, right? **Yes**.

Can two or more different MA processes have the same ACF function values? **Yes**.

Is there a special case (restricted) of MA processes that have a unique ACF function? Yes, they are called invertible MA processes.

In theory, no two invertible MA processes have the same ACF function.

## MA Invertability

An invertible MA model is one that can be represented as a converging infinite order auto-regressive model. By converging, we mean that the AR coefficient decreases to zero as we go back in time.

Using the lag-operator () notation, the moving average process can be represented as follows:

Using partial-fraction decomposition:

Where is the set of characteristic roots for the MA process. can take real or complex values.

Now, assuming that falls inside the unit circle (i.e. ) for , each fraction can be expressed as a converging geometric series:

Applying this transformation to all partial-fractions, you can express the MA process as an infinite order AR process follows:

Where

To check for invertibility, it is sufficient to find the characteristics roots and verify that their values fall inside the unit circle (). Going forward, we will only consider the invertible MA process.

### Example: MA(1)

The characteristic root for the MA(1) process is . Assuming , the algebraic AR representation of the MA(1) is expressed as follows:

The AR representation is converging as for

We are not quite done yet. There are a couple of pivotal mathematical tricks that we still need to cover: (1) Impulse response function (IRF) and (2) Integrated moving average process.

## 1. Impulse Response Function (IRF)

The impulse response function describes the model output triggered by a single shock at time T.

Applying it to a moving average model of order q, the process value is as follows:

**Note:** the IRF for an MA process is finite (q+1) and its values are equal to the coefficient.

If we have an IRF of some unknown process, can we model it as an MA process? **You bet!**

Finding the values of the MA coefficients algebraically can be tedious and complex, but using the IRF approach can vastly simplify the task.

### Example: ARMA(p,q)

Consider the general ARMA(p,q) process:

We wish to derive the MA representation of the process. We can divide the two components (i.e. AR and MA) into polynomials:

Or we can use the IRF of the ARMA process to derive the values of the MA coefficients:

Deriving the MA coefficient values is an iterative and straightforward process that will save us from carrying out complex polynomial division.

By now, you may be wondering why we would wish to convert a finite-order ARMA process to an infinite-order MA representation. For starters, forecasting (mean and error) using an MA representation is much easier than using the original higher order ARMA representation.

## 2. Integration

Integration (i.e. unit root) often arises in time series (e.g. random walk, ARIMA, etc.). In these situations, we model the differenced time series with an ARMA class model:

But how do we take the ARMA outputs back to the un-differenced scale?

### Example 1: Consider a first order integration of the MA(q) process:

To calculate the out-of-sample (i.e. forecast) values:

Alternatively,

Furthermore, the variance of the forecast value is constant after q steps:

In sum, the integrated zero-mean MA process yielded another MA process, but with a mean.

What if the differenced time series has a non-zero mean?

In this case, we have a time trend of rate equal to

For higher order integration d (), we repeat the procedure above d times, but we would need more realized observations than the last one. For example:

To solve for , we’d need , which is calculated by . Next, to solve for using the process, we’d need . In sum, are required as initial conditions for the integration.

## Conclusion

The moving average process, despite its simplicity, is a rather useful model to work with, especially when it comes to forecasting.

Armed with a couple of mathematical tricks (IRF and Integration), we can tackle many more complex processes by representing them first by an MA.

In future technical notes, we will discuss advanced models, but often refer to the MA process and material presented here.

## References

- Hamilton, J .D.; Time Series Analysis , Princeton University Press (1994), ISBN 0-691-04289-6
- D. S.G. Pollock ; Handbook of Time Series Analysis, Signal Processing, and Dynamics , Academic Press (1999), ISBN: 0125609906
- Box, Jenkins and Reisel ; Time Series Analysis: Forecasting and Control, John Wiley & SONS. (2008) 4th edition, ISBN:0470272848

Attachment | Size |
---|---|

TN-MA.pdf | 202.65 KB |