Home / Shared Math Details / Control Chart Math / Moving Ranges
Moving Ranges¶
A moving range is the spread of a short window of consecutive values. Quantum XL builds several moving range series across the control charts: some are plotted on a moving range panel, others exist only to estimate a standard deviation. This page defines how the window works, which sequence each series runs along, and how a moving range panel gets its center line and limits.
The moving range estimators themselves (average moving range over \(d_2\), median moving range over \(d_4\), and the square root of MSSD) are defined on Process Sigma Estimation. This page covers the series, not the estimators.
Notation¶
| Term | Description |
|---|---|
| \(x_t\) | the value at position \(t\) in the sequence the window runs along |
| \(L\) | moving range length: the number of consecutive values in one window (default \(2\), allowed \(2\) to \(100\)) |
| \(MR_t\) | the moving range ending at position \(t\) |
| \(\overline{MR}\) | the average of the moving ranges |
| \(\widetilde{MR}\) | the median of the moving ranges |
| \(\hat{\sigma}\) | the within sigma the panel's lines are built from |
| \(\hat{\sigma}_{\bar{x}}\) | standard deviation of the subgroup means |
| \(n^{*}\) | modal (most common) subgroup size |
| \(z_i\) | a standardized value (an observation expressed in standard deviations from its own center) |
| \(d_2, d_3, d_4\) | range constants, defined on Control Chart Constants |
| \(D_3, D_4\) | derived range limit multipliers, defined on Control Chart Constants |
| \(k\) | the sigma multiplier (number of standard deviations), default \(3\) |
| \(\text{CL}_{MR}\) | center line of a moving range panel |
How a moving range is built¶
Each moving range is the largest minus the smallest of the \(L\) values in a window that ends at the current point, where \(L\) is the moving range length (default \(2\), allowed \(2\) to \(100\)). At the default \(L = 2\) the window holds a pair of neighbors, so \(MR_t = \lvert x_t - x_{t-1} \rvert\). The value is stored against the last point of its window, so \(MR_t\) is plotted at position \(t\).
A moving range is produced only when the window is complete. Three consequences follow:
- The first \(L - 1\) points of a series have no complete window and are left unplotted. At the default \(L = 2\) that is the first point only; at \(L = 5\) the first four points are blank.
- A missing value, or a subgroup with no computable statistic, empties its slot and restarts the window, so the \(L - 1\) points that follow the gap are also unplotted. No moving range spans a gap: the sequence is never closed up around one.
- The number of moving ranges is at most the number of available values minus \(L - 1\), and every gap reduces it further.
Excluding a point as an outlier removes it from the sigma estimate, which drops the moving ranges whose window contained it, but the plotted moving range series is rebuilt from the complete data, so an excluded point does not break the plotted chain.
The moving range length¶
Moving range length is a single option that sets \(L\) for every moving range on the analysis: the plotted series and the sigma estimate use the same window. Values outside \(2\) to \(100\) are brought back inside that range, so a length of \(0\) or \(1\) behaves as \(2\). Increasing \(L\) widens each window, which raises the average moving range (a wider window has more chance to contain an extreme pair) and is why the constants are always looked up at \(L\) rather than at \(2\).
The unplotted points at the start of a series are a property of the window, not an error. A chart with \(L = 4\) simply has no moving range to show until its fourth point.
What breaks the window¶
Three things empty a slot and restart the window: a blank cell, a subgroup whose statistic cannot be computed (on a chart of subgroup means), and, for the sigma estimate only, a value removed as an outlier. On a Z-MR chart a run boundary also stops the plotted window, so the first \(L - 1\) points of every run are unplotted even though the data continue.
Two things do not break the window. A point that is out of control is an ordinary value as far as the moving ranges are concerned. And when the Nelson moving range correction removes an unusually large moving range, it removes it from the sigma estimate only: the moving range is still plotted at its original value. See Process Sigma Estimation for that correction.
The moving range series across the charts¶
Six moving range series exist across the control charts. They share the construction above and differ only in the sequence they run along.
The construction above is always the same. What differs between charts is the sequence the window slides along:
| Moving range series | Sequence the window runs over | What it feeds |
|---|---|---|
| Individual observations | the observations in worksheet order | the plotted moving range panel of an Individuals and Moving Range chart, and the average or median moving range within sigma |
| All subgroup means | every subgroup that has a mean, in worksheet order | the plotted moving range panel of an Individuals, Moving Range, and R or S chart |
| Modal-size subgroup means | only subgroups whose size equals the modal size \(n^{*}\); a subgroup of any other size empties its slot | \(\hat{\sigma}_{\bar{x}}\), the standard deviation of the subgroup means, which sets the individuals and moving range limits on that chart and drives the between-subgroup decomposition |
| Deviations from the part mean | each value minus the mean of its part, over the whole chart, over one part, or over one run, depending on the selected sigma scope | the sigma estimate of a Z-MR chart |
| Standardized values | the \(z\) values inside one run, never crossing a run boundary | the plotted moving range panel of a Z-MR chart |
| Successive absolute differences | consecutive raw values, window length fixed at \(2\), with no unbiasing constant applied | the objective minimized when a Box-Cox transformation is fitted for an individuals chart |
The second and third series matter separately: whenever subgroup sizes are unequal, the moving ranges that are plotted (built from every subgroup mean) are not the same set of numbers as the moving ranges that set the limits (built from the modal-size means only).
The Laney overdispersion factor uses a further moving range, taken over the standardized subgroup statistics at a fixed window of two; it is defined on Laney Overdispersion (Sigma Z).
The moving range panel's center line and limits¶
A moving range panel is a dispersion chart, so its lines come from the within sigma and the range constants evaluated at the moving range length \(L\), never at a subgroup size:
All three lines are level across the chart, because \(L\) is the same at every point. The lower limit is floored at zero, since a range cannot be negative; at the default \(k = 3\) and \(L = 2\) the unfloored multiplier is negative, so the lower limit is exactly \(0\) and only the upper limit can be exceeded. The zone lines are placed from the unfloored lower limit and are then floored at zero themselves.
The center line depends on how the within sigma was estimated. With the average moving range, \(\hat{\sigma} = \overline{MR}/d_2(L)\), so \(\text{CL}_{MR} = \overline{MR}\) exactly. With the median moving range, \(\hat{\sigma} = \widetilde{MR}/d_4(L)\), so \(\text{CL}_{MR} = d_2(L)\,\widetilde{MR}/d_4(L)\), which is deliberately not the median of the moving ranges. When no within sigma can be estimated, the center line and both limits are undrawn and the points plot without a band.
An Individuals chart drops its moving range panel entirely in two cases: when the within sigma is estimated from the square root of MSSD (there are no moving ranges to plot), and on a Levey-Jennings chart, which is a single panel by definition.
Moving ranges of standardized values¶
A Z-MR chart plots moving ranges of the standardized values rather than of the data, so the panel is a constant-line special case.
When the plotted moving ranges are taken from standardized values they are dimensionless, so the panel's lines are constants that depend only on the moving range length and the aggregation method. With the average moving range:
With the median moving range:
At the default length \(L = 2\) these give \(1.128\), \(3.686\), and \(0\) for the average form, and \(0.954\), \(3.120\), and \(0\) for the median form. The multiplier is fixed at \(3\) on this panel; there is no sigma multiplier setting to change it. The one-sigma spacing behind the zone lines is \((\text{UCL}_{MR} - \text{CL}_{MR})/3\), which for the average form is \(d_3(L)\), and the lower zone lines are not floored at zero.
Because these lines depend only on \(L\) and the aggregation method, two Z-MR charts built from completely different parts and different units show the same moving range band.
Successive differences are not moving ranges¶
The square root of MSSD estimator uses squared differences of consecutive pairs, always at a window of two, ignoring the moving range length entirely. It is a different construction with a different unbiasing constant, and it produces no series to plot. Its formula is on Process Sigma Estimation.
Used by¶
- Individuals and Moving Range (I-MR): the moving range panel is plotted from the individual observations, and the same series produces the within sigma. Its math page is planned.
- Individuals, Moving Range, and R or S (I-MR-R/S): the moving range panel is plotted from the subgroup means, while the limits on the first two panels come from the modal-size subset of those means. Its math page is planned.
- Z-MR: one moving range series for the sigma estimate (deviations from the part mean) and a separate one for the plotted panel (standardized values), with constant panel lines. Its math page is planned.
- Process Sigma Estimation: the average and median moving range within sigma, and the standard deviation of the subgroup means behind the between-subgroup decomposition.
- Laney Overdispersion (Sigma Z): the average moving range of the standardized subgroup statistics.
- Cpk/Histogram Math Details: the within capability block for individual observations rests on the moving range estimate.
See Also¶
- Process Sigma Estimation
- Control Chart Constants
- Control Limits and Zones
- Varying Subgroup Size Limits
- Shared Math Details
References¶
- Nelson, L. S. (1982). Control charts for individual measurements. Journal of Quality Technology, 14(3), 172-173.
- Wheeler, D. J., and Chambers, D. S. (1992). Understanding Statistical Process Control (2nd ed.). SPC Press.
- Wheeler, D. J. (1991). Short Run SPC. SPC Press.
- Roes, K. C. B., Does, R. J. M. M., and Schurink, Y. (1993). Shewhart-type control charts for individual observations. Journal of Quality Technology, 25(3), 188-198.
- Montgomery, D. C. (2013). Introduction to Statistical Quality Control (7th ed.). Wiley.
- Cryer, J. D., and Ryan, T. P. (1990). The estimation of sigma for an X chart: MR-bar/d2 or S/c4? Journal of Quality Technology, 22(3), 187-192.