Home / Statistical Tools / Control Charts / CUSUM / Math Details
Math Details¶
This page gives the exact formulas Quantum XL uses to build a CUSUM chart. Each equation lists what it computes and where it appears on the chart. Unlike the Shewhart charts, this chart has real math of its own: the two accumulations and their decision interval are defined here and nowhere else. The pieces it shares with other charts, the sigma estimates and the constants behind them, are followed by a link to the page that owns them.
Notation¶
| Term | Description |
|---|---|
| \(i\) | plotted point index, in plotted order |
| \(n_i\) | number of usable observations at point \(i\) |
| \(x_i\) | the value monitored at point \(i\): the observation itself when \(n_i = 1\), the mean of subgroup \(i\) when the data are subgrouped |
| \(\mu\) | the center of the accumulation: the Target (optional): value when you supply one, otherwise the mean of the section |
| \(\hat{\sigma}_{\text{within}}\) | estimated within-subgroup standard deviation, one value for the whole chart (one per phase when the chart is split) |
| \(\sigma_i\) | the standard deviation of the plotted value at point \(i\) |
| \(k\) | the allowance, in units of \(\sigma_i\). Dialog label Allowance (k):, default \(0.5\) |
| \(h\) | the decision interval, in units of \(\sigma_i\). Dialog label Decision interval (h):, default \(4.0\) |
| \(C_i^{+}\), \(C_i^{-}\) | the two one-sided accumulations at point \(i\). Both are non-negative magnitudes |
| \(\text{start}_i\) | the value an accumulation starts from at point \(i\) |
| \(\text{headstart}\) | the Headstart: value, in units of \(\sigma_i\), default \(2.0\) |
| \(\text{CL}_i\), \(\text{UCL}_i\), \(\text{LCL}_i\) | center line and the one-sided limits at point \(i\) |
| \(d_2(n)\), \(d_3(n)\) | expected value and standard deviation of the range of \(n\) standard normal observations |
| \(c_4(n)\) | expected value of the sample standard deviation of \(n\) standard normal observations |
| \(n_{\text{sub}}\) | number of subgroups entering an estimate |
| \(\mathcal{B}\) | the baseline set of points the estimates are computed from |
Why \(k\) is unambiguous on this page
On every other variable chart \(k\) is the sigma multiplier, the number of standard deviations the limits sit from the center line, taken from the dialog box labelled Number of standard deviations (k):. That box is not on the CUSUM dialog, and this chart never reads that setting. Its place is taken by the decision interval \(h\). So on a CUSUM chart, and on this page, \(k\) always means the allowance and nothing else. The two meanings never share a page.
The value that is monitored¶
This value is never plotted. It is the input to the accumulation, and what appears on the chart is the accumulation itself.
The center of the accumulation¶
\(T\) is the number in Target (optional): and \(\bar{x}\) is the mean of the section, estimated over the baseline set \(\mathcal{B}\). A supplied historical mean replaces \(\bar{x}\) after it has been computed.
The target is one value for the whole chart. On a split chart every phase uses the same \(T\), while a blank target lets each phase center on its own mean. Under a Box-Cox or Johnson transformation the target is transformed alongside the data, so it is entered in the original units.
Used by: the deviation each sum accumulates. It is not the center line of the chart: that is always zero.
Control chart constants¶
The constants enter through the sigma estimate only, at each subgroup's own size or at the moving range length.
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.
\(c_4(n)\) is the expected value of the sample standard deviation of \(n\) independent standard normal observations, so \(s/c_4(n)\) is an unbiased estimate of \(\sigma\). \(\Gamma\) is the gamma function. Quantum XL evaluates the formula directly (a log-gamma form is used for large \(n\); the value approaches \(1\) as \(n\) grows and is taken as \(1\) for extremely large \(n\)).
Full details, including \(d_4\) for the median moving range and \(c_4'\) for the square root of MSSD: Control Chart Constants.
Within-subgroup sigma¶
One value of \(\hat{\sigma}_{\text{within}}\) is estimated for the whole chart, and once per phase when the chart is split. Which estimators the dialog offers depends on the subgroup size, so both sets are given here.
With a subgroup size of 2 or more, three estimators are offered.
Rbar (average range), the default:
\(R_i\) is the range of subgroup \(i\), \(n_i\) its size, and \(n_{\text{sub}}\) the number of subgroups with at least two observations. Each subgroup's unbiased range estimate \(R_i/d_2(n_i)\) is combined with the minimum-variance weights \(f_i\) (subgroups whose range estimate is more precise get more weight). The unbiased-constants setting has no effect on this estimator: \(d_2\) is always applied.
This is not the textbook \(\overline{R}/d_2\) estimator. When every subgroup has the same size \(n\) all of the weights are equal and the expression collapses to \(\overline{R}/d_2(n)\), the familiar average range over \(d_2\). When the subgroup sizes differ it does not: each subgroup is weighted by the precision of its own range, so a hand calculation of \(\overline{R}/d_2\) from a mixed-size data set will not reproduce the reported value.
Sbar (average standard deviation):
With Use unbiased constants (within sigma) checked (the default):
\(s_i\) is the sample standard deviation of subgroup \(i\) (with the \(n_i - 1\) denominator) and \(h_i\) the minimum-variance weight. With the unbiased-constants box unchecked, the estimate is the plain average of the subgroup standard deviations:
The unchecked form applies no \(c_4\) at all and weights every subgroup equally, so with unequal subgroup sizes a subgroup of two observations counts as much as a subgroup of twenty five.
Pooled standard deviation:
When Use unbiased constants (within sigma) is checked (the default), the pooled estimate is divided by \(c_4(\nu + 1)\), where \(\nu = \sum_i (n_i - 1)\) is the pooled degrees of freedom:
With a subgroup size of 1 the same group offers three different estimators, built from how much consecutive points differ.
Average moving range, the default in this form:
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.
Square root of MSSD:
The sum runs over the \(m\) successive differences of consecutive non-missing observations (a missing value breaks the chain). This is the square root of half the mean squared successive difference (MSSD). When Use unbiased constants (within sigma) is checked (the default), the estimate is divided by the tabulated correction factor \(c_4'(m + 1)\).
Full details, including the degrees of freedom each estimator carries: Process Sigma Estimation.
The standard deviation of the plotted value¶
Everything on this chart is measured in units of the standard deviation of the value being monitored at that point, so that quantity is written per point:
The within sigma itself is a single chart-wide value, estimated once with the size differences already accounted for inside the estimator. Only the division by \(\sqrt{n_i}\) is per point, so \(\sigma_i\) is constant whenever the subgroup sizes are equal and steps wherever they differ.
Used by: the allowance \(k\,\sigma_i\), the decision interval \(h\,\sigma_i\), and the head start \(\text{headstart} \times \sigma_i\). All three are multiples of the same quantity, which is why they scale together.
The two accumulations¶
Both sums are recursions over the plotted points, and both are floored at zero:
The allowance \(k\,\sigma_i\) is subtracted from the deviation before anything accumulates, on both sides. A deviation smaller than the allowance therefore reduces the running total instead of increasing it, and the flooring at zero stops a long quiet stretch from building up credit that would delay a later signal. A process sitting on \(\mu\) holds both sums at exactly zero.
The starting value of each recursion is:
A restart happens at the first plotted point of the chart, at the first plotted point of every phase, and, when Reset accumulation after a signal is on, at the first plotted point after a signal. The head start is evaluated with the \(\sigma_i\) of the point it is applied at, not with the \(\sigma_i\) of the point that triggered the restart, so a change of subgroup size scales it correctly. The two sums restart independently. Each carries its own running total, so a signal on the upper sum restarts the upper sum only and leaves the lower sum accumulating unchanged, and the reverse.
Used by: the two plotted series.
What is plotted, and the negated lower sum¶
The lower sum is plotted negated. \(C_i^{-}\) is a non-negative magnitude exactly like \(C_i^{+}\): it grows as the process drifts below \(\mu\). It is drawn as a negative number so that downward drift appears below the center line, where a reader expects it. So the series labelled C- on the chart shows \(-C_i^{-}\), and a value of \(-3.2\) on that series means the lower accumulation has reached \(3.2\).
This matters when you read a value off the chart or out of the summary table, and it matters when you compare a plotted value with the limit: the signal test below is stated on the magnitudes, not on the drawn values.
Center line and limits¶
Each series has one limit and not two. The upper series has no lower limit and the lower series has no upper limit, so those two lines are not computed and not drawn. Both series share the center line at zero.
The decision interval does not widen over time. It is a fixed multiple of \(\sigma_i\), so with equal subgroup sizes \(\sigma_i\) is the same at every point and the two limits are straight horizontal lines from the first point to the last. They step only where the subgroup size changes.
This is the opposite of the EWMA chart
Readers group the two time weighted charts together and assume their limits behave alike. They do not. An EWMA chart's limits are built from a per-point variance factor that starts near zero and grows, so its band starts narrow at the center line and widens point by point toward an asymptote, and the widening is a property of the point number. A CUSUM chart's decision interval has no such term. It varies with one thing only, the subgroup size at that point, so on a chart with a constant subgroup size it is flat from beginning to end.
When a point signals¶
A point signals when its accumulation, the magnitude rather than the drawn value, is strictly greater than the decision interval:
Each series is tested against its own limit, and the two are counted separately in the summary table. The point that signalled is still plotted at the value it reached, and, when Reset accumulation after a signal is on, it is the point after it that restarts.
This test is applied at the moment each sum is computed, and it is the only out-of-control test on this chart. The rule detector that the other charts run over the finished series is not invoked here at all, so this flagging happens whatever the Rule 1 checkbox is set to. The run, trend, and zone rules are not offered on this chart, and no zone boundaries are produced for them to read.
When a point is left blank¶
A CUSUM chart is never left with a blank point, because it will not run with one.
A blank point stops the analysis
A CUSUM chart refuses to run at all if any point has no usable value: a blank observation, a subgroup with no usable observations, or a subgroup whose sigma cannot be computed. The run ends with no chart and the message "Time-weighted charts require a value at every time step - fill or remove the missing value(s)."
This is the opposite of how the Shewhart charts behave. There, a gap is plotted as a gap and only breaks the run being counted. Here it is refused outright, which is deliberate: an accumulation that silently skipped a time step would no longer mean what its name says.
Fill the gap or remove the row before running the chart. Both accumulations therefore advance at every point on a chart that was produced at all.
Baseline and split limits¶
Neither of these changes the formulas above; both change which points the estimates run over, and splitting also changes where the recursion begins.
Estimate Limits From restricts the mean and the sigma estimate to the first \(N\) plotted points and then applies the resulting center and decision interval across the whole chart. On this chart the minimum is 5 points, the window advances past blank points and excluded outliers rather than spending a slot on them, and every point is still accumulated and still plotted. 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 mean, its own within sigma, and therefore its own allowance and its own decision interval. The accumulation is re-run per phase as well: both sums start again at the first point of each phase, with the head start reapplied there when FIR is on, so drift accumulated at the end of one phase never carries into the next. A baseline count is reused inside each phase, capped at that phase's length. A target you entered is not per phase: the same value is used in every one. 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 |
|---|---|---|
| Control chart constants | \(d_2\) and \(d_3\) in the range and moving range estimates, \(c_4\) in the Sbar and pooled estimates, \(d_4\) and \(c_4'\) in the two remaining ones | Control Chart Constants |
| Process sigma estimation | the six estimates of \(\hat{\sigma}_{\text{within}}\), three for subgrouped data and three for individual observations | Process Sigma Estimation |
| Moving ranges | how the moving ranges are formed at a subgroup size of 1 | Moving Ranges |
| Baseline and limit estimation | what Estimate Limits From restricts, and what it does not | Baseline and Limit Estimation |
| Splits and phases | per-phase estimation, and the boundary the accumulation restarts at | Splits and Phases |
Everything else on this page is specific to CUSUM. The general limit form, the zone construction, and the numbered out-of-control rules used by the Shewhart charts play no part here: this chart's limit is the decision interval, it produces no zones, and its only test is the accumulation test above.
See Also¶
References¶
- Page, E. S. (1954). Continuous inspection schemes. Biometrika, 41(1/2), 100-115.
- Lucas, J. M., and Crosier, R. B. (1982). Fast initial response for CUSUM quality-control schemes: Give your CUSUM a head start. Technometrics, 24(3), 199-205.
- Hawkins, D. M., and Olwell, D. H. (1998). Cumulative Sum Charts and Charting for Quality Improvement. Springer.
- Montgomery, D. C. (2013). Introduction to Statistical Quality Control (7th ed.). Wiley.