Skip to main content
WAMathematics ApplicationsSyllabus dot point

How do we fit a trend line to a time series and forecast future values?

Fit a least-squares trend line to a time series, forecast future values, and reseasonalise forecasts for seasonal data.

How to fit a least-squares trend line to a time series using a numerical time variable, forecast future values, and reseasonalise a forecast when the data is seasonal.

Generated by Claude Opus 4.77 min answer

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this dot point is asking
  2. Numbering time
  3. Forecasting seasonal data
  4. Reliability of forecasts
  5. Choosing the method

What this dot point is asking

You must fit a trend line against a numerical time variable, forecast with it, and combine it with seasonal indices when the data is seasonal.

Numbering time

To fit a line, time must be numerical, so number the periods 1,2,3,1, 2, 3, \dots This time number becomes the explanatory variable and the series value the response.

Forecasting seasonal data

When data is seasonal, the trend line should be fitted to the deseasonalised values, because the raw seasonal swing would distort the slope. The full procedure has three steps.

Reliability of forecasts

A forecast is an extrapolation beyond the data, so the further ahead you forecast, the less reliable it becomes. The trend may not continue, and irregular shocks cannot be predicted, which you should state when reporting a forecast.

Choosing the method

For data with no seasonality, fit the trend line directly to the raw values and forecast in one step. For seasonal data, deseasonalise first, forecast the trend, then reseasonalise. Identifying whether seasonality is present decides which route you take.