SARIMA (Seasonal ARIMA) › Visualizing SARIMA

Michael BrenndoerferAugust 11, 20254 min read
Machine Learning from ScratchAll chapters
Part 8 of 9Time Series
Chapter 58SARIMA (Seasonal ARIMA) › Visualizing SARIMA
Reading section 4 of 9 · Visualizing SARIMA · 4 minSection 4 of 9 · 4 min

Book contents

Section 4 of 9 · 4 min read

SARIMA (Seasonal ARIMA) › Visualizing SARIMAOne section · Sections in this chapter4 / 9 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

Let's create a visualization that demonstrates the main components and behavior of a SARIMA model. We'll generate a synthetic time series with both trend and seasonal components, then show how SARIMA decomposes and models this data.

Out[3]:
Visualization
Monthly time series from 2010 to 2020 with a rising trend and repeating annual oscillations.
Original monthly series containing the upward trend, annual seasonal cycle, and random variation used in the additive decomposition.
Trend line increasing smoothly from roughly 105 to 195 over the decomposition period.
Extracted trend component showing the long-term increase in the time series after seasonal and residual variation are removed.
Out[4]:
Visualization
Repeating seasonal line oscillating between approximately minus 20 and plus 20 each year.
Extracted seasonal component showing the repeating 12-month cycle centered around zero.
Residual time series fluctuating irregularly around zero between approximately minus 10 and plus 10.
Residual component showing the irregular variation left after subtracting the estimated trend and seasonal components.

This visualization shows how SARIMA decomposes a time series into its fundamental components. The original series exhibits both a clear upward trend and regular seasonal fluctuations. The decomposition reveals the underlying trend component that captures the long-term growth pattern, the seasonal component that shows the repeating annual cycle, and the residual component that contains the random noise and any patterns not captured by trend and seasonality.

Out[5]:
Visualization
ACF stem plot from lag 0 to 40 with a confidence band and slowly decaying, repeating positive correlations including a seasonal rise near lag 12.
Autocorrelation function through lag 40 with 95% confidence limits. The repeating peaks, including elevated correlation around seasonal lag 12, reveal the series' annual dependence structure.
PACF stem plot from lag 0 to 40 with a confidence band, prominent early-lag spikes, and smaller conditional correlations at later lags.
Partial autocorrelation function through lag 40 with 95% confidence limits. The isolated conditional correlations help identify plausible autoregressive orders after controlling for shorter lags.

The ACF and PACF plots reveal the autocorrelation structure used to determine appropriate SARIMA model parameters. The ACF shows significant correlations at lags 12 and 24, indicating strong seasonal patterns with a 12-month cycle. The PACF helps identify the order of autoregressive terms by showing the partial correlations after removing the effects of intermediate lags.