Home / Statistical Tools / Control Charts / Moving Range / Math Details
Math Details¶
This page gives the exact formulas Quantum XL uses to build a Moving Range chart. Each equation lists what it computes and where it appears on the chart. Every formula on this page is shared with other control charts, so each block is followed by a link to the page that owns it.
Notation¶
| Term | Description |
|---|---|
| \(t\), \(i\) | point index, in plotted order. Both letters appear in the shared blocks below and mean the same thing here |
| \(x_t\) | the observation in row \(t\). It is not plotted on this chart |
| \(n_{\text{pts}}\) | number of plotted points |
| \(L\) | moving range length, the number of consecutive observations in one window, default \(2\) |
| \(MR_t\) | the moving range ending at point \(t\), the value plotted on this chart |
| \(m\) | number of moving ranges |
| \(\overline{MR}\), \(\widetilde{MR}\) | the average and the median of the moving ranges |
| \(\hat{\sigma}_{\text{within}}\) | estimated within sigma |
| \(k\) | sigma multiplier (number of standard deviations), default \(3\) |
| \(d_2(n)\), \(d_3(n)\), \(d_4(n)\) | expected value, standard deviation, and median of the range of \(n\) standard normal observations |
| \(D_3\), \(D_4\) | the derived lower and upper multiples of a moving range panel's center line |
| \(\mathcal{B}\) | the baseline set of points the estimates are computed from |
| \(\text{CL}_{MR}\), \(\text{UCL}_{MR}\), \(\text{LCL}_{MR}\) | center line, upper and lower control limits of this panel |
There is no subgroup size on this chart. Every row carries exactly one observation, and every constant below is evaluated at the moving range length \(L\) rather than at a subgroup size, which is why all three lines are straight.
Plotted statistic¶
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.
Full details: Moving Ranges.
The series is built from every row, whatever the baseline selection is, because the baseline governs the limits and never what is plotted.
The individuals panel of this dialog is computed even on this variant, where it is not drawn. Its center line is the mean of the observations and its limits are that mean plus and minus \(k\,\hat{\sigma}_{\text{within}}\), as set out on the Individuals Math Details page.
Control chart constants¶
The range constants are looked up at the moving range length on this chart, never at a subgroup size, so the same \(d_2(L)\) appears in the sigma estimate and in this panel's center line.
The range constants describe the distribution of the range \(R\) of \(n\) independent standard normal observations:
So \(R/d_2(n)\) is an unbiased estimate of \(\sigma\) from a subgroup range, \(d_3(n)\) scales the spread of a range, and \(\widetilde{R}/d_4(n)\) is the corresponding estimate from a median range. Quantum XL evaluates these from precomputed full-precision tables for \(n = 2\) to \(100\). Outside that range they are undefined, which is why a subgroup size or moving range length above \(100\) produces no estimate and no limits.
Full details: Control Chart Constants.
The tables run from \(2\) to \(100\), which is exactly the range the Moving range length: box accepts.
Within sigma¶
This variant offers two estimators of \(\hat{\sigma}_{\text{within}}\), and one value is estimated once for the whole chart (once per phase when the chart is split). The panel's three lines are built from it.
Average moving range, the default:
Each moving range \(MR_t\) is the maximum minus the minimum of \(L\) consecutive non-missing observations (\(L\) is the moving range length, default \(2\), in which case \(MR_t = |x_t - x_{t-1}|\)), and \(m\) is the number of moving ranges. A missing value breaks the chain of consecutive observations, so no moving range spans a gap.
When Use Nelson moving-range correction is checked, moving ranges larger than \(D_4(L)\,\overline{MR}\), with \(D_4(L) = 1 + 3\,d_3(L)/d_2(L)\), are removed and the average is recomputed. This repeats until no moving range exceeds the recomputed threshold (at most 50 iterations); a moving range removed in one pass stays removed in every later pass. The multiplier in that threshold is always \(3\), whatever sigma multiplier the chart is drawn with. The correction affects only the sigma estimate, not the moving range values themselves, and it is offered only with the average moving range method. If it removes every moving range, no within sigma can be computed.
Median moving range:
\(\widetilde{MR}\) is the median of the moving ranges (the average of the two middle values when their count is even), and \(d_4(L)\) is the unbiasing constant for the median range of \(L\) standard normal observations. The moving ranges are formed exactly as in the average moving range method.
Full details, including the degrees of freedom each estimator carries: Process Sigma Estimation.
Both divide by a constant of their own, which is why the Use unbiased constants (within sigma) checkbox is disabled while either is selected. The third estimator of this dialog, the square root of MSSD, is offered only on the Individuals variant.
Center line and limits¶
A dispersion panel does not sit at a fixed distance from a center line: its limits are multiples of its own center line, and those multiples are built from the range constants and the sigma multiplier.
A dispersion panel (a range, moving range, or standard deviation chart) places its limits at multiples of its own center line, and those multiples are built from the constants above with the chart's sigma multiplier \(k\). For a range or moving range panel:
A standard deviation panel is built the same way from the \(c\) constants, at \(1 - k\,c_5/c_4\) and \(1 + k\,c_5/c_4\) times its center line. Those two multiples are the ones conventionally tabulated as \(B_3\) and \(B_4\); Quantum XL computes them directly from \(c_4\) and \(c_5\) rather than reading a named factor. In both cases the lower multiple is floored at \(0\), because neither a range nor a standard deviation can be negative, and \(k\) is the multiplier the chart is drawn with rather than a fixed \(3\).
Evaluated at the moving range length, they give this 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.
Full details: Moving Ranges and Control Chart Constants.
Two consequences are worth stating plainly. Under the median moving range the center line is deliberately not the median of the plotted points, because it is rebuilt from the sigma estimate rather than read off the plotted series. And the lower limit is floored at zero, so at the default \(L = 2\) and \(k = 3\) there is no lower limit to fall below and the chart can only signal upward.
When a point is left blank¶
The blanking rules on this chart come from the moving range window rather than from a subgroup size. The first \(L - 1\) points have no complete window, a missing observation empties its own slot and restarts the window, and no moving range is ever formed across a gap. All three cases are set out in the construction block above, and every one of them costs more than a single point once \(L\) is larger than \(2\).
A gap also breaks any run the out-of-control tests were counting.
Sigma zones¶
The zone lines, and the out-of-control tests that read them, are placed by cutting the drawn band into thirds on each side. The sigma multiplier does not enter the calculation.
On the variable charts the band that is actually drawn is cut into thirds on each side, and the sigma multiplier \(k\) does not enter the calculation:
Each side is measured from its own limit, so an asymmetric band gives asymmetric zone lines, and a manual band is divided the same way as a calculated one. On the range, standard deviation, and moving range panels the zone lines are built from the unclamped lower limit and then floored at zero, so when the drawn lower limit has been clamped to zero the lower zone lines are not thirds of the band that appears on the chart.
Full details: Control Limits and Zones.
The final sentence of that block is the case this chart is normally in. The lower zone lines are computed from the unfloored lower limit and then floored themselves, so whenever the drawn lower limit has been clamped to zero the lower zone lines do not divide the band you can see. The four tests that read the zones, rules 5 through 8, do not run on this chart in any case: they need a location panel, and this variant draws none, so their rows are greyed out in the dialog.
Baseline and split limits¶
Neither of these changes the formulas above; both change which points the sums run over.
Estimate Limits From restricts every estimate to the first \(N\) points and then extends the resulting center line and limits across the whole chart. The number of moving ranges that window supplies is smaller than the number of observations it holds:
With the default moving range length \(L = 2\), a baseline of \(N_b^{\text{eff}}\) points supplies at most \(N_b^{\text{eff}} - 1\) moving ranges, and fewer when a gap inside the baseline breaks the chain of consecutive values.
On this chart the minimum is 5 points, the window advances past blank rows and excluded outliers rather than spending a slot on them, and the plotted values, the minimum, the maximum, and the counts are always computed from all of the data. Formulas: Baseline and Limit Estimation.
Split Control Limits divides the chart into phases and re-runs the whole estimation inside each one, so each phase gets its own within sigma, its own center line and limits, and its own zone lines, and every out-of-control run counter restarts at the boundary. A baseline count is reused inside each phase, capped at that phase's length. One transformation is fitted for the whole chart rather than one per phase. Formulas: Splits and Phases.
Shared Math Details used here¶
This chart uses shared formulas defined once in Shared Math Details.
| Shared concept | Used here for | Reference |
|---|---|---|
| Moving ranges | the plotted series, its window and its gaps, and the panel's three lines | Moving Ranges |
| Control chart constants | \(d_2\) and \(d_4\) in the sigma estimate, and the \(D_3\) and \(D_4\) multiples of the center line | Control Chart Constants |
| Process sigma estimation | the average and median moving range estimates of the within sigma | Process Sigma Estimation |
| Control limits and zones | the zone construction, and the manual and disabled limit types | Control Limits and Zones |
| Baseline and limit estimation | what Estimate Limits From restricts, and how many moving ranges a baseline supplies | Baseline and Limit Estimation |
| Splits and phases | per-phase estimation and the run counters restarting | Splits and Phases |
| Out-of-control rules | flagging out-of-control points, rules 1 through 4 only | Out-of-Control Rules |
The Moving Range chart contributes no formula of its own. Every equation above is one of these shared pieces evaluated for a chart of the moving ranges of single observations.
See Also¶
References¶
- Montgomery, D. C. (2013). Introduction to Statistical Quality Control (7th ed.). Wiley.
- Wheeler, D. J., and Chambers, D. S. (1992). Understanding Statistical Process Control (2nd ed.). SPC Press.
- Duncan, A. J. (1986). Quality Control and Industrial Statistics (5th ed.). Irwin.
- Shewhart, W. A. (1931). Economic Control of Quality of Manufactured Product. Van Nostrand.