Time Series • Time Series Analysis and Components
Time Series / P2.09 General Forecasting Workflow

P2.09 General Forecasting Workflow

Practical 2 Time Series Analysis and Components

Write and implement the general modelling cycle on a short series: display, describe, choose a simple model, check residuals of the naive method, and plan monitoring.

Practical / Solution

P2.09 General Forecasting Workflow

Problem Statement

Write and implement the general modelling cycle on a short series: display, describe, choose a simple model, check residuals of the naive method, and plan monitoring.

Learning Outcomes

  • Follow display then describe then model.
  • Inspect naive residuals.

Theory

A general approach is: plot, summarise, transform if needed, choose a model, check residuals, forecast, then monitor against later actuals.

Dataset / Data Source

Constructed 10 monthly observations.

Analysis / Program

import pandas as pd y = pd.Series([5, 6, 6, 7, 9, 8, 10, 11, 10, 12]) naive = y.shift(1) resid = y - naive print(pd.DataFrame({"y": y, "naive": naive, "residual": resid})) print("Mean residual after first obs:", round(resid.iloc[1:].mean(), 3))

Expected Output

A table of naive one-step residuals. The mean residual is computed from these 10 numbers.

Result / Interpretation

If naive residuals still show a pattern, a mean is not enough. That is the Unit 2 message: the workflow includes residual inspection, even for a simple method.

Note

A method is not finished until residuals and later actuals have been looked at.