Components of Time Series

A Time Series can usually be broken down into a handful of underlying components, each capturing a different kind of pattern in the data.

Trend

The long-term upward or downward movement in the data over an extended period, ignoring short-term fluctuations.

Seasonality

Regular, repeating patterns tied to a fixed calendar period - such as higher retail sales every December or increased electricity usage every summer.

Cyclic Variation

# Unlike seasonality, cycles don't have a fixed period
# Example: economic boom-and-bust cycles lasting several years,
# with no exact repeating interval

Irregular (Residual) Variation

The remaining random noise left after trend, seasonality, and cyclic patterns have been accounted for - often caused by unpredictable, one-off events.

Decomposing a Time Series in Python

from statsmodels.tsa.seasonal import seasonal_decompose

result = seasonal_decompose(df["Sales"], model="additive", period=12)
result.plot()
An "additive" model assumes components simply sum together, while a "multiplicative" model assumes they multiply - the right choice depends on whether seasonal swings grow with the trend.

Coming Up Next

Next, you'll learn practical techniques for visualizing Time Series data.

Ready to Master Data Science?

Join Uncodemy's Data Science Course and build real, job-ready skills with expert mentors.

Explore Course