Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Lesson 10 — Time Series for Business/Economics

(trend, seasonality, forecasting baselines, and honest evaluation)

Why this matters (motivation)

Business and economics are full of time-indexed questions:

Time series analysis gives a disciplined way to:


Time series mindset: time is not just another variable

Unit of observation (again)

Be explicit:

This determines what “seasonality” means and what forecasts are useful.


Describing time series: the three components

A useful conceptual decomposition: [ y_t = \text{trend}_t + \text{seasonality}_t + \text{noise}_t ] (or multiplicative forms when growth is proportional).

Trend

Long-run movement (growth/decline).

Seasonality

Regular cycles (day-of-week, monthly, quarterly).

Noise (irregular component)

Random shocks, measurement noise, one-off events.


Forecasting as a benchmark game

Baseline 1: naïve

[ \hat{y}_{t+1} = y_t ]

Baseline 2: seasonal naïve

[ \hat{y}{t+h} = y{t+h-s} ] where (s) is seasonal period (e.g., 12 for monthly with yearly seasonality).

Baseline 3: moving average

Forecast using recent average: [ \hat{y}{t+1} = \frac{1}{k}\sum{i=0}^{k-1} y_{t-i} ]


How to evaluate forecasts (practically)

Time-based splitting

Example:

Metrics (choose one or two and interpret)


Visual communication for time series

Minimum set of plots that actually helps:

  1. Line plot of the series (with clear time axis)

  2. Rolling average (optional) to show trend

  3. Seasonality view (e.g., month-of-year average or day-of-week average)

  4. Forecast plot: actual vs predicted for the test window


Mini case options (choose one)

Option A (business): sales forecasting

Option B (economics): OWID time series

Use an OWID dataset that is time-indexed (country-year, country-month, etc.). Examples:

Focus: describe trend/seasonality and create a baseline forecast.


Mini-lab (Google Colab)

In-class checkpoints (data preparation)

  1. Load a time series dataset with a clear time column.

  2. Sort by time and set the time column correctly (datetime or integer year).

  3. Plot the full time series and write one sentence describing the main pattern.

In-class checkpoints (decomposition / pattern checks)

  1. Compute a rolling average (choose a window and justify).

  2. If seasonal frequency exists (e.g., monthly), compute a seasonal profile:

    • average by month-of-year or day-of-week.

In-class checkpoints (forecast baselines)

  1. Create a train/test split by time (e.g., last 20% as test).

  2. Implement at least two baselines:

    • naïve

    • moving average OR seasonal naïve

  3. Plot predictions vs actual in the test window.

In-class checkpoints (evaluation)

  1. Compute MAE and RMSE for each baseline on the test window.

  2. Choose the “best” baseline and justify using both:

Submission (after class)


AI check (responsible use for time series)

Good prompt examples

Bad prompt example


Review questions (quiz / reflection)

  1. Why should train/test splits be done by time for forecasting?

  2. What is a naïve forecast, and why is it a strong baseline?

  3. When might MAPE be misleading?

  4. Give one factor that could cause a forecast to fail (structural break).