Time Series • Statistics Background for Forecasting
Time Series / P3.07 Fit an ARMA Model

P3.07 Fit an ARMA Model

Practical 3 Statistics Background for Forecasting

Fit ARMA(1,1) to a mixed constructed series and explain why both AR and MA may be needed.

Practical / Solution

P3.07 Fit an ARMA Model

Problem Statement

Fit ARMA(1,1) to a mixed constructed series and explain why both AR and MA may be needed.

Learning Outcomes

  • State ARMA as AR plus MA on a stationary series.
  • Avoid over-parameterising a short series.

Theory

ARMA(p,q) combines autoregression and moving average on a stationary series (d = 0). Small p and q are preferred for teaching series.

Dataset / Data Source

Constructed stationary mix of AR and MA shocks. Teaching data.

Analysis / Program

import numpy as np import pandas as pd from statsmodels.tsa.arima.model import ARIMA rng = np.random.default_rng(9) e = rng.normal(size=160) y = np.zeros(160) for t in range(1, 160): y[t] = 0.4 * y[t-1] + e[t] + 0.3 * e[t-1] y = pd.Series(y) fit = ARIMA(y, order=(1, 0, 1)).fit() print(fit.summary()) print("AIC:", round(fit.aic, 1))

Expected Output

A model summary and AIC. Coefficients will be near the construction values but not identical.

Result / Interpretation

ARMA is for stationary mixed dependence. If the level wanders, differencing (ARIMA) is considered next. AIC is a comparison aid, not a substitute for plots.

Note

Choose small orders first. Extra parameters can fit noise.