Sign in to save

Bookmark this page so you can find it later.

Sign in to save

Bookmark this page so you can find it later.

Time series forecasting uses data collected in time order to estimate future values. It matters in science, business, engineering, and public policy because many decisions depend on what is likely to happen next. Examples include predicting electricity demand, disease cases, weather measurements, stock levels, or website traffic.

A good forecast separates useful patterns from random ups and downs.

Key Facts

  • A time series is ordered data: y1, y2, y3, ..., yt, where t represents time.
  • A simple additive model is yt = Trendt + Seasonalt + Noiset.
  • Naive forecast: forecast for the next period equals the most recent observation, so F(t+1) = yt.
  • Moving average forecast with window n: F(t+1) = (yt + y(t-1) + ... + y(t-n+1)) / n.
  • Forecast error is actual minus forecast: et = yt - Ft.
  • Mean absolute error is MAE = (|e1| + |e2| + ... + |en|) / n.

Vocabulary

Time series
A time series is a set of measurements recorded in chronological order.
Trend
A trend is the long term upward or downward movement in a time series.
Seasonality
Seasonality is a repeating pattern that occurs at regular time intervals, such as daily, monthly, or yearly.
Noise
Noise is random variation in data that does not follow a stable pattern.
Prediction interval
A prediction interval is a range of values that is expected to contain a future observation with a stated level of confidence.

Common Mistakes to Avoid

  • Ignoring the time order of the data is wrong because shuffling observations destroys trends, seasonality, and lag relationships.
  • Using a simple average when there is a strong trend is wrong because old data can pull the forecast away from the current direction of change.
  • Treating every repeated rise and fall as seasonality is wrong because true seasonality must repeat at a consistent time interval.
  • Judging a forecast only by how it looks is wrong because accuracy should also be measured with errors such as MAE, RMSE, or MAPE.

Practice Questions

  1. 1 Monthly sales for the last four months are 120, 135, 150, and 165 units. What is the naive forecast for next month, and what is the 3-month moving average forecast?
  2. 2 A forecast for five weeks was 50, 55, 60, 65, and 70. The actual values were 52, 53, 63, 61, and 74. Compute the forecast errors and the MAE.
  3. 3 A store sells more ice cream every summer and less every winter, but total yearly sales are slowly increasing. Explain which parts of this pattern are trend, seasonality, and noise.