AI Glossary / Retrieval and knowledge systems / Beginner

Moving average

Definition

A moving average is an average recalculated over a window that moves through a sequence of observations. In time-series analysis, it is commonly used to smooth short-term fluctuations and make broader patterns easier to inspect. The result depends on the window length, weighting and alignment chosen for the calculation.

What it means

Instead of averaging the entire history each time, a simple moving average focuses on a specified group of neighboring values. As the window advances, a new value enters and an old one leaves. This creates a smoothed series that changes more gradually than many raw series.

The term also has a distinct technical meaning in time-series models such as ARIMA, where a moving-average component represents a combination of current and past error terms. That model component should not be confused with the rolling arithmetic smoother explained here.

How it works

For a simple trailing average of length n, add the latest n observations and divide by n. Label the result according to the chosen time convention, commonly at the latest observation in the window. Repeating the calculation produces the smoothed series.

A centered average uses observations on both sides of a time point, making it useful for retrospective smoothing but unavailable immediately at the end of a live series without future data. Weighted moving averages assign different importance to positions; an exponentially weighted average uses a different, recursive weighting scheme.

Specify whether windows are defined by observation count or elapsed time, how missing values are handled and whether incomplete initial windows are allowed. These choices can change both the values and their interpretation.

Three practical examples

1. A service dashboard displays a seven-day average of daily requests alongside the raw counts to help readers distinguish noise from a persistent change.

2. A model-training chart smooths a sequence of loss measurements so that the general direction is easier to inspect, while retaining access to unsmoothed values.

3. An operations analyst tests a trailing moving average as a simple forecasting baseline and compares its errors with methods designed to handle trend or seasonality.

Think of it this way

Think of viewing a bumpy path through a small window that averages the bumps inside it. A wider window makes the path look smoother, but it can blur the point where the path turns. The average is useful for seeing a pattern, provided the reader remembers that it is a summary of several observations rather than the original value at one moment.

Worked example

Suppose an invented daily series is 12, 18, 15, 21 and 24. Use complete trailing windows of three days. The average at day three is (12 + 18 + 15)/3 = 15. At day four it is (18 + 15 + 21)/3 = 18. At day five it is (15 + 21 + 24)/3 = 20.

If day six has value 30, the next average is (21 + 24 + 30)/3 = 25. The same update can be obtained from the previous window sum of 60 by removing 15 and adding 30, giving 75, then dividing by three.

Using the day-five average of 20 as a one-step forecast for day six would produce an error of 30 minus 20 = 10 under the actual-minus-forecast convention. That is a forecasting choice, separate from the smoothing calculation itself.

The example assumes equally spaced days, no missing observations and equal weights. It shows how the window moves and why a rising series can leave the average behind the latest observation; it does not establish forecasting quality from one error.

Illustrative case study

Fictional case: Hazel Operations adds a rolling average to a workload dashboard. Managers find the broad pattern easier to follow, but a sudden increase after a service change appears less dramatic in the smoothed line.

The team keeps raw counts visible and labels the averaging window clearly. When evaluating a forecast based on the average, analysts use only data available before each prediction and compare several horizons. They choose the dashboard window for readability and assess forecasting performance separately, rather than assuming the same setting is ideal for both tasks.

Common misconceptions and mistakes

A moving average does not remove all noise or identify the cause of a change. A smoother line is not automatically more accurate, and a large window can delay the visible response to a genuine shift.

Do not mix centered and trailing averages in a forecasting comparison without accounting for future information. A window of seven observations is not necessarily seven days if timestamps are irregular. Averaging daily ratios without considering their denominators can also answer a different question from calculating one ratio from pooled counts. Always specify what values are being averaged.

Business use

Moving averages can make operational trends easier to communicate and provide transparent baseline calculations. Select a window that fits the reporting frequency and the pattern being investigated. Show the raw data or make them accessible when short-lived events matter.

For forecasting, use time-respecting evaluation and compare against simple alternatives. Document missing-data rules and initial-window handling so that different dashboards produce consistent numbers. Avoid interpreting changes in a smoothed indicator as causal evidence, and check whether trend, seasonality or abrupt shifts require a more appropriate analytical approach.

People also ask

Is a longer window always better?

No. It usually smooths more strongly but responds more slowly to changes.

Can a moving average be used as a forecast?

Yes, as a specified baseline, but a basic rolling average may lag trends and does not automatically model seasonality.

Is the moving average in ARIMA the same calculation?

No. The ARIMA component describes a model involving error terms, while the smoother here averages observed values over a moving window.

Check your understanding

A complete four-period trailing average currently uses 8, 12, 16 and 20. The next observation is 24. What is the new average?

Answer: Remove 8 and average 12, 16, 20 and 24. Their sum is 72, so the new average is 72/4 = 18.

Related terms

  • Smoothing
  • Exponential smoothing
  • Double moving average
  • rolling window
  • weighted moving average
  • trend
  • forecast horizon and moving-average process

Learn next

compare short and long trailing windows on a series with a trend and a sudden jump. Then contrast a centered smoother with a real-time calculation. Evaluate any forecasting use on observations excluded from the calculation.

More in Retrieval and knowledge systems

  • Match rating approach - The Match rating approach (MRA) is a rule-based method for comparing names through compact phonetic encodings and a rating procedure.
  • Metaphone - Metaphone is a phonetic encoding algorithm that converts a word into a compact code using spelling rules intended to approximate aspects of its pronunciation.
  • Microaveraging - Microaveraging combines evaluation evidence across classes or labels before calculating the final metric.
  • Music alignment - Music alignment is the process of identifying corresponding musical positions across different representations or performances of a work.
  • Next word index - A next word index, often written nextword index in information-retrieval research, organizes words by the words that immediately follow them in documents.
  • NYSIIS phonetic code - The NYSIIS phonetic code is a letter-based encoding used to group names with similar spelling-to-sound patterns.

Sources

Primary sources: NIST/SEMATECH e-Handbook, Single Moving Average: https://www.itl.nist.gov/div898/handbook/pmc/section4/pmc421.htm

NIST/SEMATECH e-Handbook, Centered Moving Average: https://www.itl.nist.gov/div898/handbook/pmc/section4/pmc422.htm

Hyndman, Glossary of Forecasting Terms, distinct moving-average meanings: https://robjhyndman.com/mwh3/FG4.pdf

Previous: Move-to-front transform Next: Moving average crossover

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer