Time Series • Statistics Background for Forecasting
Time Series / P3.06 Fit a Moving-Average Model

P3.06 Fit a Moving-Average Model

Practical 3 Statistics Background for Forecasting

Fit MA(1) to a constructed series where noise is smoothed by a one-lag shock, and explain MA in words.

Practical / Solution

P3.06 Fit a Moving-Average Model

Problem Statement

Fit MA(1) to a constructed series where noise is smoothed by a one-lag shock, and explain MA in words.

Learning Outcomes

  • Describe MA(1) as today's value depending on the last shock.
  • Fit ARIMA(0,0,1).

Theory

An MA(1) model uses the previous error, not the previous observation. ACF of a true MA(1) cuts off after lag 1.

Dataset / Data Source

Constructed MA(1): y_t = e_t + 0.6 e_{t-1}.

Analysis / Program

import numpy as np import pandas as pd from statsmodels.tsa.arima.model import ARIMA rng = np.random.default_rng(8) e = rng.normal(size=150) y = pd.Series(e + 0.6 * np.r_[0, e[:-1]]) fit = ARIMA(y, order=(0, 0, 1)).fit() print(fit.summary())

Expected Output

An ARIMA(0,0,1) summary. The MA coefficient should be in the neighbourhood of 0.6 for this construction.

Result / Interpretation

MA terms capture short-lived shocks. If ACF cuts off quickly, an MA model is a candidate. Always confirm with residuals.

Note

MA is about shocks, AR is about past values. They are not the same idea.