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.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
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 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.