Skip to content

Lesson 1 of 4

Free preview

Trend, seasonality and noise

Look at a series before forecasting it.

14 min 3-question quiz 3 guides to read next

A time series is a sequence of measurements in time order. Most can be understood as three parts added together:

  • Trend: the long-term direction.
  • Seasonality: patterns that repeat on a fixed cycle — daily, weekly, yearly.
  • Noise: what's left, which no model can predict.
import pandas as pd

temps = pd.read_csv("https://data.giss.nasa.gov/gistemp/tabledata_v4/GLB.Ts+dSST.csv",
                    skiprows=1, na_values="***")
annual = temps.set_index("Year")["J-D"].dropna()   # annual mean anomaly, °C

annual.rolling(10).mean().plot()                    # a 10-year moving average shows the trend

The GISTEMP series is mostly trend: global temperature anomalies have risen markedly since the late 1970s. It has little seasonality at the annual level, and a lot of year-to-year noise.

Bike sharing rentals are the opposite: strong seasonality (more rides in summer, at rush hour, on working days), plus growth between 2011 and 2012.

Always plot the series first. It tells you which of these parts matter, and reveals gaps, outliers and changes in how the data was recorded.

Check your understanding

3 questions · pass with 2 correct

1. Which three parts make up most time series?
2. Bike rentals rise in summer and at rush hour. That's…
3. What should you always do first?

You'll see your score; enrol to have it count towards your certificate.

Enrol for free to save your progress, unlock every lesson and earn a certificate.

Sign in to enrol

Further reading

Guides that go deeper on this lesson.

  • Time Series Forecasting Basics

    Trend, seasonality, baselines and time-based validation: the fundamentals of predicting future values from past ones.

    2 min read

  • Time Series Analysis for Analysts

    Decomposing trends and seasonality, handling calendar effects and comparing periods fairly in business reporting.

    2 min read

  • Data Visualisation Principles

    How to make charts that communicate clearly: choosing chart types, honest scales, reducing clutter and highlighting the point.

    2 min read