Time Series • Introduction to Time Series
Time Series / P1.03 Identify Internal Structures

P1.03 Identify Internal Structures

Practical 1 Introduction to Time Series

Using a 24-month sales series, identify signs of trend, seasonality, cyclical movement and irregular shocks. Do not fit ARIMA.

Practical / Solution

P1.03 Identify Internal Structures

Problem Statement

Using a 24-month sales series, identify signs of trend, seasonality, cyclical movement and irregular shocks. Do not fit ARIMA.

Learning Outcomes

  • Name the four classical components.
  • Point to features in a plot that suggest each component.

Hint

Trend is the long drift. Seasonality repeats at a known interval. Cyclical movement is a slower rise and fall. Irregular points do not repeat.

Theory

An observed series can mix trend, seasonal variation, cyclical variation and irregular variation. Unit 1 asks you to recognise these ideas visually, not to estimate them with advanced models.

Dataset / Data Source

Constructed monthly sales for two years: a slow rise, higher values every December, one unusually low month after a simulated disruption. Not a public download.

Analysis / Program

import pandas as pd import numpy as np import matplotlib.pyplot as plt # Build a teaching series with known features idx = pd.date_range("2024-01-01", periods=24, freq="MS") trend = np.linspace(80, 110, 24) seasonal = [8 if m == 12 else (-4 if m in [6, 7] else 0) for m in idx.month] irregular = np.zeros(24) irregular[14] = -18 # unusual drop sales = trend + seasonal + irregular ts = pd.Series(sales, index=idx, name="sales") ts.plot(marker="o", title="Monthly sales with mixed components") plt.axvline(idx[14], linestyle="--") plt.tight_layout() plt.show() print(ts.round(1))

Expected Output

A 24-point line chart: overall climb, December peaks, a marked drop near point 15, and a printed monthly table of constructed values.

Result / Interpretation

The climb is trend. December peaks are seasonal. The isolated drop is irregular. Two years is short for a full business cycle, so any slower wave should be discussed cautiously as possible cyclical movement, not proven.

Note

Do not call every wiggle seasonal. Seasonality repeats at a known period such as month or quarter.