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.
Understanding Statistics: Time Series Forecasting
The order of the observations is the main feature that makes this kind of data different from an ordinary list. A value from last week may be closely related to a value from this week. Values from the same month in earlier years may have something in common too.
A long-term trend shows gradual movement upward or downward. Seasonal behaviour repeats on a regular calendar cycle, such as higher ice cream sales in summer or greater energy use on cold evenings.
Noise is the leftover variation caused by small events, measurement limits, or factors that were not recorded. Forecasting works best when these parts are considered separately rather than treated as one unexplained pattern.
Simple methods are important because they provide a fair starting point. Using the latest value as the next prediction can work surprisingly well when changes are slow. A moving average smooths sudden jumps by combining several recent values.
It reduces the effect of one unusual day, but it can react too slowly when the true level has changed. A short averaging window responds quickly but remains jumpy. A longer window is steadier but may miss a rapid change.
More advanced models can give extra weight to recent observations, estimate trends, or represent repeating seasons. Their added complexity is only useful when it improves predictions on data the model has not already seen.
Testing a forecast needs care because future data must stay in the future during the test. A student should fit a method using an earlier section of the series, make predictions for later dates, then compare those predictions with the actual values. The difference between an actual value and its forecast is the forecast error.
Looking at the average size of these errors shows how far off a method tends to be. Mean absolute error is useful because it measures error size without allowing positive and negative errors to cancel out.
It is sensible to compare a new model against a simple latest-value forecast. If the new model is not more accurate than that baseline, it may not be worth using.
Real data often creates the hardest problems. Missing dates, changed measuring equipment, recording mistakes, and one-off events can distort a pattern. A shop might have unusual sales during a local festival.
A weather station might show a sudden shift after it moves location. These observations should not be deleted automatically. First, check whether they are errors or genuine events.
Forecasts should include uncertainty because no model knows future surprises. A prediction range is more honest than one exact number, especially far ahead in time. When learning this topic, plot the data first, label the time scale clearly, notice repeated cycles, and ask whether outside information could explain major changes.
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 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 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 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.