# Moving-average model

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Moving-average_model
> Markdown URL: https://mediated.wiki/source/Moving-average_model.md
> Source: https://en.wikipedia.org/wiki/Moving-average_model
> Source revision: 1340159064
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

Time series model

Not to be confused with [Moving average](/source/Moving_average).

In [time series analysis](/source/Time_series_analysis), the **moving-average model** (**MA model**), also called the **moving-average process**, is a standard approach for modeling [univariate](/source/Univariate) time series.[1][2]

An MA model expresses the current value of a [time series](/source/Time_series) as a linear function of current and past random shocks (error terms) with finite lag length. In contrast to an [autoregressive model](/source/Autoregressive_model), which regresses the variable on its past values, the moving-average model relies solely on the dependency structure of the error terms.

Together with the [autoregressive (AR) model](/source/Autoregressive_model), the moving-average model is a special case and key component of the more general [ARMA](/source/Autoregressive%E2%80%93moving-average_model) and [ARIMA](/source/Autoregressive_integrated_moving_average) models of [time series](/source/Time_series),[3] which have a more complicated stochastic structure. Contrary to the AR model, the finite MA model is always [stationary](/source/Stationary_process).

The moving-average model should not be confused with the [moving average](/source/Moving_average), a distinct concept despite some similarities.[4]

## Definition

The notation MA(*q*) refers to the moving average model of order *q*:

- X t = μ + ε t + θ 1 ε t − 1 + ⋯ + θ q ε t − q = μ + ∑ i = 1 q θ i ε t − i + ε t , {\displaystyle X_{t}=\mu +\varepsilon _{t}+\theta _{1}\varepsilon _{t-1}+\cdots +\theta _{q}\varepsilon _{t-q}=\mu +\sum _{i=1}^{q}\theta _{i}\varepsilon _{t-i}+\varepsilon _{t},}

where μ {\displaystyle \mu } is the mean of the series, the θ 1 , . . . , θ q {\displaystyle \theta _{1},...,\theta _{q}} are the coefficients of the model[*[example needed](https://en.wikipedia.org/wiki/Wikipedia:AUDIENCE)*] and ε t , ε t − 1 , . . . , ε t − q {\displaystyle \varepsilon _{t},\varepsilon _{t-1},...,\varepsilon _{t-q}} are the 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](/source/Backshift_operator) *B* as[5]

- X t = μ + ( 1 + θ 1 B + ⋯ + θ q B q ) ε t . {\displaystyle X_{t}=\mu +(1+\theta _{1}B+\cdots +\theta _{q}B^{q})\varepsilon _{t}.}

Thus, a moving-average model is conceptually a [linear regression](/source/Linear_regression) of the current value of the series against current and previous (observed) 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](/source/Normal_distribution), with location at zero and constant scale.

## Interpretation

The moving-average model is essentially a [finite impulse response](/source/Finite_impulse_response) filter applied to white noise, with some additional interpretation placed on it.[*[clarification needed](https://en.wikipedia.org/wiki/Wikipedia:Please_clarify)*] The role of the random shocks in the MA model differs from their role in the [autoregressive (AR) model](/source/Autoregressive_model) in two ways. First, they are propagated to future values of the time series directly: for example, ε t − 1 {\displaystyle \varepsilon _{t-1}} appears directly on the right side of the equation for X t {\displaystyle X_{t}} . In contrast, in an AR model ε t − 1 {\displaystyle \varepsilon _{t-1}} does not appear on the right side of the X t {\displaystyle X_{t}} equation, but it does appear on the right side of the X t − 1 {\displaystyle X_{t-1}} equation, and X t − 1 {\displaystyle X_{t-1}} appears on the right side of the X t {\displaystyle X_{t}} equation, giving only an indirect effect of ε t − 1 {\displaystyle \varepsilon _{t-1}} on X t {\displaystyle X_{t}} . Second, in the MA model a shock affects X {\displaystyle X} values only for the current period and *q* periods into the future; in contrast, in the AR model a shock affects X {\displaystyle X} values infinitely far into the future, because ε t {\displaystyle \varepsilon _{t}} affects X t {\displaystyle X_{t}} , which affects X t + 1 {\displaystyle X_{t+1}} , which affects X t + 2 {\displaystyle X_{t+2}} , and so on forever (see [Impulse response](/source/Vector_autoregression#Impulse_response)).

## Fitting the model

Fitting a moving-average model is generally more complicated than fitting an [autoregressive model](/source/Autoregressive_model).[6] This is because the lagged error terms are not observable. This means that iterative [non-linear fitting](/source/Curve_fitting) procedures need to be used in place of linear least squares. Moving average models are linear combinations of past white noise terms, while autoregressive models are linear combinations of past time series values.[7] ARMA models are more complicated than pure AR and MA models, as they combine both autoregressive and moving average components.[6]

The [autocorrelation function](/source/Autocorrelation_function) (ACF) of an MA(*q*) process is zero at lag *q* + 1 and greater. Therefore, 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*.

Sometimes the ACF and [partial autocorrelation function](/source/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 method](/source/Box%E2%80%93Jenkins_method#Identify_p_and_q)).

Autoregressive Integrated Moving Average (ARIMA) models are an alternative to [segmented regression](/source/Segmented_regression) that can also be used for fitting a moving-average model.[8]

## See also

- [Autoregressive–moving-average model](/source/Autoregressive%E2%80%93moving-average_model)

- [Autoregressive integrated moving average](/source/Autoregressive_integrated_moving_average)

- [Autoregressive model](/source/Autoregressive_model)

- [Finite impulse response](/source/Finite_impulse_response)

- [Infinite impulse response](/source/Infinite_impulse_response)

## References

1. **[^](#cite_ref-ShumwayStoffer_1-0)** [Shumway, Robert H.](/source/Robert_H._Shumway); [Stoffer, David S.](/source/David_S._Stoffer) (2017). *Time Series Analysis and Its Applications: With R Examples*. Springer. [ISBN](/source/ISBN_(identifier)) [978-3-319-52451-1](https://en.wikipedia.org/wiki/Special:BookSources/978-3-319-52451-1). [OCLC](/source/OCLC_(identifier)) [966563984](https://search.worldcat.org/oclc/966563984).

1. **[^](#cite_ref-2)** ["2.1 Moving Average Models (MA models)"](https://online.stat.psu.edu/stat510/lesson/2/2.1). *PennState: Statistics Online Courses*. Retrieved 27 February 2023.

1. **[^](#cite_ref-3)** Shumway, Robert H.; [Stoffer, David S.](/source/David_S._Stoffer) (2019-05-17), ["ARIMA Models"](https://dx.doi.org/10.1201/9780429273285-5), *Time Series: A Data Analysis Approach Using R*, Boca Raton : CRC Press, Taylor & Francis Group, 2019.: Chapman and Hall/CRC, pp. 99–128, [doi](/source/Doi_(identifier)):[10.1201/9780429273285-5](https://doi.org/10.1201%2F9780429273285-5), [ISBN](/source/ISBN_(identifier)) [978-0-429-27328-5](https://en.wikipedia.org/wiki/Special:BookSources/978-0-429-27328-5), retrieved 2023-02-27{{[citation](https://en.wikipedia.org/wiki/Template:Citation)}}: CS1 maint: location ([link](https://en.wikipedia.org/wiki/Category:CS1_maint:_location)) CS1 maint: work parameter with ISBN ([link](https://en.wikipedia.org/wiki/Category:CS1_maint:_work_parameter_with_ISBN))

1. **[^](#cite_ref-:0_4-0)** Shumway, Robert H.; [Stoffer, David S.](/source/David_S._Stoffer) (19 April 2017). *Time series analysis and its applications : with R examples*. Springer. [ISBN](/source/ISBN_(identifier)) [978-3-319-52451-1](https://en.wikipedia.org/wiki/Special:BookSources/978-3-319-52451-1). [OCLC](/source/OCLC_(identifier)) [966563984](https://search.worldcat.org/oclc/966563984).

1. **[^](#cite_ref-5)** Box, George E. P.; Jenkins, Gwilym M.; Reinsel, Gregory C.; Ljung, Greta M. (2016). *Time series analysis : forecasting and control* (5th ed.). Hoboken, New Jersey: John Wiley & Sons, Incorporated. p. 53. [ISBN](/source/ISBN_(identifier)) [978-1-118-67492-5](https://en.wikipedia.org/wiki/Special:BookSources/978-1-118-67492-5). [OCLC](/source/OCLC_(identifier)) [908107438](https://search.worldcat.org/oclc/908107438).

1. ^ [***a***](#cite_ref-:1_6-0) [***b***](#cite_ref-:1_6-1) ["Autoregressive Moving Average ARMA(p, q) Models for Time Series Analysis - Part 1 | QuantStart"](https://www.quantstart.com/articles/Autoregressive-Moving-Average-ARMA-p-q-Models-for-Time-Series-Analysis-Part-1/). *www.quantstart.com*. Retrieved 2023-02-27.

1. **[^](#cite_ref-7)** ["Autoregressive Moving Average ARMA(p, q) Models for Time Series Analysis - Part 2 | QuantStart"](https://www.quantstart.com/articles/Autoregressive-Moving-Average-ARMA-p-q-Models-for-Time-Series-Analysis-Part-2/). *www.quantstart.com*. Retrieved 2023-02-27.

1. **[^](#cite_ref-8)** Schaffer, Andrea L.; Dobbins, Timothy A.; Pearson, Sallie-Anne (2021-03-22). ["Interrupted time series analysis using autoregressive integrated moving average (ARIMA) models: a guide for evaluating large-scale health interventions"](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7986567). *BMC Medical Research Methodology*. **21** (1): 58. [doi](/source/Doi_(identifier)):[10.1186/s12874-021-01235-8](https://doi.org/10.1186%2Fs12874-021-01235-8). [ISSN](/source/ISSN_(identifier)) [1471-2288](https://search.worldcat.org/issn/1471-2288). [PMC](/source/PMC_(identifier)) [7986567](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7986567). [PMID](/source/PMID_(identifier)) [33752604](https://pubmed.ncbi.nlm.nih.gov/33752604).

## Further reading

- Enders, Walter (2004). "Stationary Time-Series Models". *Applied Econometric Time Series* (Second ed.). New York: Wiley. pp. 48–107. [ISBN](/source/ISBN_(identifier)) [0-471-45173-8](https://en.wikipedia.org/wiki/Special:BookSources/0-471-45173-8).

## External links

- [Common approaches to univariate time series](http://www.itl.nist.gov/div898/handbook/pmc/section4/pmc444.htm)

v t e Stochastic processes Discrete time Bernoulli process Branching process Chinese restaurant process Galton–Watson process Independent and identically distributed random variables Markov chain Moran process Random walk Loop-erased Self-avoiding Biased Maximal entropy Continuous time Additive process Airy process Bessel process Birth–death process pure birth Brownian motion Bridge Dyson Excursion Fractional Geometric Meander Cauchy process Contact process Continuous-time random walk Cox process Diffusion process Empirical process Feller process Fleming–Viot process Gamma process Geometric process Hawkes process Hunt process Interacting particle systems Itô diffusion Itô process Jump diffusion Jump process Lévy process Local time Markov additive process McKean–Vlasov process Ornstein–Uhlenbeck process Poisson process Compound Non-homogeneous Quasimartingale Schramm–Loewner evolution Semimartingale Sigma-martingale Stable process Superprocess Telegraph process Variance gamma process Wiener process Wiener sausage Both Branching process Gaussian process Hidden Markov model (HMM) Markov process Martingale Differences Local Sub- Super- Random dynamical system Regenerative process Renewal process Stochastic chains with memory of variable length White noise Fields and other Dirichlet process Gaussian random field Gibbs measure Hopfield model Ising model Potts model Boolean network Markov random field Percolation Pitman–Yor process Point process Cox Determinantal Poisson Random field Random graph Time series models Autoregressive conditional heteroskedasticity (ARCH) model Autoregressive integrated moving average (ARIMA) model Autoregressive (AR) model Autoregressive moving-average (ARMA) model Generalized autoregressive conditional heteroskedasticity (GARCH) model Moving-average (MA) model Financial models Binomial options pricing model Black–Derman–Toy Black–Karasinski Black–Scholes Chan–Karolyi–Longstaff–Sanders (CKLS) Chen Constant elasticity of variance (CEV) Cox–Ingersoll–Ross (CIR) Garman–Kohlhagen Heath–Jarrow–Morton (HJM) Heston Ho–Lee Hull–White Korn-Kreer-Lenssen LIBOR market Rendleman–Bartter SABR volatility Vašíček Wilkie Actuarial models Bühlmann Cramér–Lundberg Risk process Sparre–Anderson Queueing models Bulk Fluid Generalized queueing network M/G/1 M/M/1 M/M/c Properties Càdlàg paths Continuous Continuous paths Ergodic Exchangeable Feller-continuous Gauss–Markov Markov Mixing Piecewise-deterministic Predictable Progressively measurable Self-similar Stationary Time-reversible Limit theorems Central limit theorem Donsker's theorem Doob's martingale convergence theorems Ergodic theorem Fisher–Tippett–Gnedenko theorem Large deviation principle Law of large numbers (weak/strong) Law of the iterated logarithm Maximal ergodic theorem Sanov's theorem Zero–one laws (Blumenthal, Borel–Cantelli, Engelbert–Schmidt, Hewitt–Savage, Kolmogorov, Lévy) Inequalities Burkholder–Davis–Gundy Doob's martingale Doob's upcrossing Kunita–Watanabe Marcinkiewicz–Zygmund Tools Cameron–Martin theorem Convergence of random variables Doléans-Dade exponential Doob decomposition theorem Doob–Meyer decomposition theorem Doob's optional stopping theorem Dynkin's formula Feynman–Kac formula Filtration Girsanov theorem Infinitesimal generator Itô integral Itô's lemma Kolmogorov continuity theorem Kolmogorov extension theorem Kosambi–Karhunen–Loève theorem Lévy–Prokhorov metric Malliavin calculus Martingale representation theorem Optional stopping theorem Prokhorov's theorem Quadratic variation Reflection principle Skorokhod integral Skorokhod's representation theorem Skorokhod space Snell envelope Stochastic differential equation Tanaka Stopping time Stratonovich integral Uniform integrability Usual hypotheses Wiener space Classical Abstract Disciplines Actuarial mathematics Control theory Econometrics Ergodic theory Extreme value theory (EVT) Large deviations theory Mathematical finance Mathematical statistics Probability theory Queueing theory Renewal theory Ruin theory Signal processing Statistics Stochastic analysis Time series analysis Machine learning List of topics Category

This article incorporates [public domain material](/source/Copyright_status_of_works_by_the_federal_government_of_the_United_States) from the [National Institute of Standards and Technology](https://www.nist.gov)

---
Adapted from the Wikipedia article [Moving-average model](https://en.wikipedia.org/wiki/Moving-average_model) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Moving-average_model?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
