Skip to content

Home / Statistical Tools / Control Charts / EWMA / Math Details

Math Details

This page gives the exact formulas Quantum XL uses to build an EWMA chart. Each equation lists what it computes and where it appears on the chart. Unlike the Shewhart charts, EWMA has math of its own: the smoothing recursion and the per-point variance factor that makes its limits widen. Everything else on this page is a shared formula, and each shared block is followed by a link to the page that owns it.

Notation

Term Description
\(i\) plotted point index, in plotted order
\(n_i\) number of usable observations at point \(i\). It is \(1\) on individuals data
\(x_{ij}\) the \(j\)th observation in subgroup \(i\)
\(x_i\) the value entering the smoothing at point \(i\): the subgroup mean, or the raw observation when \(n_i = 1\)
\(\bar{\bar{x}}\) grand mean, the center line of the chart
\(\lambda\) the EWMA weight, dialog label EWMA weight (λ):, default \(0.2\), accepted greater than \(0\) and up to and including \(1\)
\(\text{EWMA}_i\) the smoothed statistic plotted at point \(i\)
\(V_i\) the per-point variance factor, in units of \(\hat{\sigma}_{\text{within}}^2\)
\(\hat{\sigma}_{\text{within}}\) estimated within-subgroup standard deviation
\(\sigma_i\) standard deviation of the plotted statistic at point \(i\)
\(k\) sigma multiplier (number of standard deviations), default \(3\)
\(v_i\) the value plotted at point \(i\), which on this chart is \(\text{EWMA}_i\). Used by the shared rule statement
\(\mathcal{B}\) the baseline set of subgroups the estimates are computed from
\(\text{CL}\), \(\text{UCL}_i\), \(\text{LCL}_i\) center line, upper and lower control limits at point \(i\)

\(\lambda\) on this page is the EWMA weight only. The Box-Cox power parameter uses the same letter, and the two never meet here because the Box-Cox formulas are linked rather than repeated.

The value that is smoothed

\[ x_i = \frac{1}{n_i}\sum_{j=1}^{n_i} x_{ij}, \qquad x_i = x_{i1} \text{ when } n_i = 1 \]

The chart runs on the same series as a Shewhart chart of the same data: the subgroup mean at each point, or the observation itself when the data is individual values. Every point contributes, whatever the baseline selection is, because the baseline governs the estimates behind the limits and never what is plotted.

The plotted statistic

\[ \text{EWMA}_i = \lambda\,x_i + (1 - \lambda)\,\text{EWMA}_{i-1}, \qquad \text{EWMA}_0 = \bar{\bar{x}} \]

The recursion is seeded at the center line, so the chart starts from the grand mean rather than from the first observation. Unrolling it shows what each point actually contains:

\[ \text{EWMA}_i = \lambda \sum_{t=0}^{i-1} (1-\lambda)^{t}\,x_{i-t} \;+\; (1-\lambda)^{i}\,\bar{\bar{x}} \]

Every earlier value is in the point, with a weight that falls off geometrically, and the seed itself fades at the same rate. At \(\lambda = 1\) the sum collapses to \(x_i\) and the chart plots the values themselves. As \(\lambda\) falls the memory gets longer and the plotted line gets smoother.

A blank point stops the analysis

An EWMA chart will not run at all if any point has no usable value. This is unlike the Shewhart charts, which plot a gap and carry on. 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)."

Fill the gap or remove the row before you run the chart. The recursion below therefore never has to skip a step: every point it advances through has a value.

Used by: the single plotted series on the EWMA panel.

Center line

\[ \bar{\bar{x}} = \frac{\displaystyle\sum_{i \in \mathcal{B}}\;\sum_{j=1}^{n_i} x_{ij}}{\displaystyle\sum_{i \in \mathcal{B}} n_i} \]

The center line is the mean of the individual observations, not the mean of the subgroup means, so with unequal subgroup sizes a larger subgroup carries more weight. It is a single value for the whole chart (one per phase when the chart is split), and it does not move from point to point.

A supplied historical mean replaces \(\bar{\bar{x}}\) after it has been computed, so the baseline still decides which subgroups fed the estimate that was discarded. Because the recursion is seeded at the center line, a supplied mean also changes where the plotted series starts.

Used by: the center line of the panel, the seed of the recursion, the Center row of the summary table, and the value the control limits are measured from.

Within-subgroup sigma

One value of \(\hat{\sigma}_{\text{within}}\) is estimated for the whole chart (one per phase when the chart is split), and the entire band is built from it. Which estimators are offered depends on the shape of the data. The constants \(d_2\), \(d_3\), \(d_4\), \(c_4\), and \(c_4'\) used below are defined on Control Chart Constants.

With subgroups of two or more, three estimators are offered.

Rbar (average range), the default:

\[ \hat{\sigma}_{\text{within}} = \frac{\sum_{i=1}^{n_{\text{sub}}} f_i\, \dfrac{R_i}{d_2(n_i)}}{\sum_{i=1}^{n_{\text{sub}}} f_i}, \qquad f_i = \left(\frac{d_2(n_i)}{d_3(n_i)}\right)^{2} \]

\(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):

\[ \hat{\sigma}_{\text{within}} = \frac{\sum_{i=1}^{n_{\text{sub}}} h_i\, \dfrac{s_i}{c_4(n_i)}}{\sum_{i=1}^{n_{\text{sub}}} h_i}, \qquad h_i = \frac{c_4(n_i)^2}{1 - c_4(n_i)^2} \]

\(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:

\[ \hat{\sigma}_{\text{within}} = \frac{1}{n_{\text{sub}}}\sum_{i=1}^{n_{\text{sub}}} s_i \]

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:

\[ \hat{\sigma}_{\text{within}} = \sqrt{\frac{\sum_{i=1}^{n_{\text{sub}}} (n_i - 1)\, s_i^2}{\sum_{i=1}^{n_{\text{sub}}} (n_i - 1)}} \]

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:

\[ \hat{\sigma}_{\text{within}}^{\,\text{unbiased}} = \frac{1}{c_4(\nu + 1)}\sqrt{\frac{\sum_{i} (n_i - 1)\, s_i^2}{\nu}} \]

With a constant subgroup size of \(1\) there is no within-subgroup spread to work with, and three different estimators are offered in their place.

Average moving range, the default for individual values:

\[ \hat{\sigma}_{\text{within}} = \frac{\overline{MR}}{d_2(L)}, \qquad \overline{MR} = \frac{1}{m}\sum_{t} MR_t \]

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:

\[ \hat{\sigma}_{\text{within}} = \frac{\widetilde{MR}}{d_4(L)} \]

\(\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:

\[ \hat{\sigma}_{\text{within}} = \sqrt{\frac{\sum_{i=1}^{m} (x_{i+1} - x_i)^2}{2\,m}} \]

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.

A supplied historical within standard deviation replaces whichever of these was computed, and then the band is built from the supplied number instead.

Control limits, and why they widen

This is the part of an EWMA chart that has no counterpart on a Shewhart chart. The plotted statistic at point \(i\) is a weighted sum of everything before it, so its variance depends on how far into the series the point is, on the weight, and on the size of every subgroup that has contributed so far. Quantum XL accumulates all three in one factor, computed recursively alongside the plotted series:

\[ V_i = (1 - \lambda)^2\,V_{i-1} + \frac{\lambda^2}{n_i}, \qquad V_0 = 0 \]
\[ \sigma_i = \hat{\sigma}_{\text{within}}\,\sqrt{V_i}, \qquad \text{UCL}_i = \bar{\bar{x}} + k\,\sigma_i, \qquad \text{LCL}_i = \bar{\bar{x}} - k\,\sigma_i \]

The limits start narrow and widen. Because the recursion is seeded at \(V_0 = 0\), the first plotted point carries only its own contribution, \(V_1 = \lambda^2 / n_1\), and each point after it adds a little more before the \((1-\lambda)^2\) factor discounts what is already there. The band therefore opens from close to the center line and grows, fast at first and then hardly at all, toward a steady width. That funnel at the left of the chart is the visual signature of an EWMA chart, and it is the correct band: an early point genuinely is a smoothed value of very little data.

When every subgroup is the same size \(n\), the recursion has a closed form that shows the shape directly:

\[ V_i = \frac{\lambda}{(2 - \lambda)\,n}\left(1 - (1-\lambda)^{2i}\right) \]

The bracket rises from near zero toward \(1\), so the width settles at

\[ \sigma_\infty = \hat{\sigma}_{\text{within}}\sqrt{\frac{\lambda}{(2 - \lambda)\,n}} \]

At the default \(\lambda = 0.2\) with individual values, the first point's limits sit at \(0.6\,\hat{\sigma}_{\text{within}}\) either side of the center line at \(k = 3\), and the band settles at \(1.0\,\hat{\sigma}_{\text{within}}\), reaching within one percent of that final width by about the tenth point. A smaller weight gives a narrower final band that takes longer to get there.

Quantum XL does not use that closed form. It runs the recursion, which is what keeps the limits correct when the subgroup sizes are not all equal: each point advances the accumulator with its own \(n_i\), so a large subgroup tightens the band from that point on and a small one loosens it. The closed form above is exact only for equal sizes and is shown here to explain the shape, not as the calculation.

\(V_i\) advances at every point, because the chart refuses to run at all when a point has no value. There is no gap for the variance factor to step over.

Full details of the general limit form: Control Limits and Zones.

There is no flooring and no capping on this panel. The smoothed statistic can legitimately be any value, so both limits are drawn wherever the arithmetic puts them.

Sigma zones

EWMA has zone lines, and they widen with the band, because they are cut from the band that is actually drawn:

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:

\[ A_i^{+} = \text{CL}_i + \tfrac{2}{3}\left(\text{UCL}_i - \text{CL}_i\right), \qquad B_i^{+} = \text{CL}_i + \tfrac{1}{3}\left(\text{UCL}_i - \text{CL}_i\right) \]
\[ B_i^{-} = \text{CL}_i - \tfrac{1}{3}\left(\text{CL}_i - \text{LCL}_i\right), \qquad A_i^{-} = \text{CL}_i - \tfrac{2}{3}\left(\text{CL}_i - \text{LCL}_i\right) \]

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, including what the labels "1 sigma" and "2 sigma" really mean at a multiplier other than \(3\): Control Limits and Zones.

Two things follow on this chart. The zone lines are drawn at each point from that point's own limits, so they form their own funnel inside the band. And no out-of-control test reads them here, because EWMA offers Rule 1 only, so on this chart they are a reading aid rather than an input to a test.

The out-of-control test

EWMA offers one test, Rule 1, applied to the widening limits:

Point \(i\) is flagged when the plotted value falls outside the limits drawn at that point:

\[ v_i > \text{UCL}_i \qquad \text{or} \qquad v_i < \text{LCL}_i \]

Both comparisons are strict, so a point sitting exactly on a control limit is not flagged. The test uses the limits as drawn, which means it follows stepped limits, manual limits, and transformed data with no special handling. The rule has no threshold of its own: its width is the chart's sigma multiplier \(k\), chosen with the control limits.

The engine also supports an independent multiple \(k^{*}\) for this rule. When one is supplied, one sigma of the plotted statistic is recovered separately for each side from the drawn limits,

\[ \sigma_i^{+} = \frac{\text{UCL}_i - \text{CL}_i}{k}, \qquad \sigma_i^{-} = \frac{\text{CL}_i - \text{LCL}_i}{k} \]

and the test is applied at \(k^{*}\) of those units instead:

\[ v_i > \text{CL}_i + k^{*}\,\sigma_i^{+} \qquad \text{or} \qquad v_i < \text{CL}_i - k^{*}\,\sigma_i^{-} \]

Recovering each side on its own means an asymmetric band gives an asymmetric per-side sigma. The only chart that uses an independent multiple is Levey-Jennings, whose 1-2s warning is this same test at \(k^{*} = 2\). On every other chart Rule 1 tests the drawn limits.

On this chart \(v_i\) is \(\text{EWMA}_i\) and the limits are the per-point limits above, so a point is flagged when the smoothed statistic falls outside the band drawn at its own position. Early points are judged against a narrow band and later points against the settled one. No independent multiple is used here.

The engine runs this test whether or not the check box is ticked. The rule configuration for an EWMA chart is built inside the engine with Rule 1 enabled, and the rule check box from the dialog is not consulted. Clearing it does not stop points being flagged.

What does stop it is turning the limits off:

Setting the control limit type to None does not have the same effect on every chart.

  • On the attribute and rare-event charts the center line is still drawn while the limits and the zone lines are removed. Rule 1 and the zone rules cannot fire, because the values they compare against are gone, but rules 2, 3, 4, and 9 need only the center line or the order of the plotted values, so they still fire and still color points.
  • On the variable charts nothing is flagged at all. The limits, the zone lines, and the whole rule result are removed together.

Full details: Out-of-Control Rules.

Baseline and split limits

Neither of these changes the formulas above; both change which points the estimates are computed from.

Estimate Limits From restricts the grand mean and the within sigma to the first \(N\) points and then extends the resulting center line and band across the whole chart. The shape of the plotted series does not change, but its position does: the recursion is seeded at the center line, so a baseline that moves the center line moves the start of the series with it. The minimum is 5 points, the window advances past blank subgroups 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 calculation inside each one. Each phase gets its own grand mean, its own within sigma, and its own limits, and on this chart it also gets its own smoothing: the recursion is re-seeded at that phase's center line and the variance accumulator restarts at \(V_0 = 0\), so the band narrows to the center line at every phase boundary and widens again. A split EWMA chart therefore shows one funnel per phase. 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

Apart from the recursion and the variance factor above, this chart uses shared formulas defined once in Shared Math Details.

Shared concept Used here for Reference
Control chart constants \(d_2\), \(d_3\), \(d_4\), \(c_4\), and \(c_4'\) inside the sigma estimators Control Chart Constants
Process sigma estimation the six estimates of the within-subgroup sigma, three for subgrouped data and three for individual values Process Sigma Estimation
Moving ranges how the moving ranges behind the individuals estimators are formed Moving Ranges
Control limits and zones the general limit form, the zone construction, and what the None limit type removes Control Limits and Zones
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 phase boundaries the recursion restarts at Splits and Phases
Out-of-control rules the single Rule 1 test against the per-point limits Out-of-Control Rules
Box-Cox transformation rescaling the measurements before any of the above, when a transformation is selected Box-Cox Transformation

See Also

References

  1. Roberts, S. W. (1959). "Control Chart Tests Based on Geometric Moving Averages." Technometrics, 1(3), 239-250.
  2. Hunter, J. S. (1986). "The Exponentially Weighted Moving Average." Journal of Quality Technology, 18(4), 203-210.
  3. Lucas, J. M., and Saccucci, M. S. (1990). "Exponentially Weighted Moving Average Control Schemes: Properties and Enhancements." Technometrics, 32(1), 1-12.
  4. Montgomery, D. C. (2013). Introduction to Statistical Quality Control (7th ed.). Wiley.