Time Series • Introduction to Time Series
Time Series / P1.07 Simple Forecasting Workflow

P1.07 Simple Forecasting Workflow

Practical 1 Introduction to Time Series

Carry out the Unit 1 forecasting process on a short monthly series: define the problem, inspect data, choose a simple method, make one-step estimates and state how you would monitor them.

Practical / Solution

P1.07 Simple Forecasting Workflow

Problem Statement

Carry out the Unit 1 forecasting process on a short monthly series: define the problem, inspect data, choose a simple method, make one-step estimates and state how you would monitor them.

Learning Outcomes

  • Follow a systematic forecasting process.
  • Use a simple method only (mean or naive), not ARIMA.

Hint

Write the eight process steps, then implement only a naive or trailing-mean forecast.

Theory

The process is: define the problem, collect data, prepare data, select a method, build the model, evaluate, generate the forecast, monitor performance.

Dataset / Data Source

Constructed 12 monthly sales values. Teaching data.

Analysis / Program

import pandas as pd import numpy as np idx = pd.date_range("2025-01-01", periods=12, freq="MS") sales = [50, 52, 51, 55, 57, 60, 58, 61, 64, 63, 66, 70] ts = pd.Series(sales, index=idx, name="sales") # Simple method: average of last 3 months forecast = ts.tail(3).mean() print("Problem: forecast next month sales") print("Method: trailing 3-month mean") print("Forecast:", round(forecast, 1)) # Crude in-sample check using last 3 one-step means errors = [] for i in range(9, 12): pred = ts.iloc[i-3:i].mean() errors.append(ts.iloc[i] - pred) print("Last three one-step errors:", [round(e, 1) for e in errors])

Expected Output

A next-month trailing-mean forecast printed from the given values, plus three one-step errors for the last months. Do not treat these as universal constants.

Result / Interpretation

The workflow is more important than the method. Students should name the problem, the data, the simple rule, a rough check, and the need to compare later actual sales with the forecast.

Note

Unit 1 stops at a simple workflow. ARIMA belongs to Unit 3.