EWMA chart: how λ and L work, with time-varying limits
An EWMA chart (exponentially weighted moving average) plots a running average in which each new observation gets weight λ and all past data together get weight 1 − λ. Older values fade out gradually instead of dropping off all at once. Because the plotted statistic averages many observations, its limits are narrow, and the chart detects small, sustained shifts in the mean much sooner than an individuals chart.
When to use it
- You chart individual values or subgroup means and the shifts that matter are small: 0.5 to 1.5 standard deviations.
- Changes tend to be gradual: depletion, wear, slow contamination, sensor drift.
- The data are not quite normal. The averaging makes the EWMA statistic close to normal even when single values are somewhat skewed.
For large, sudden upsets, an individuals chart is faster and easier to read; many sites run both. The CUSUM chart has similar power for small shifts; the moving average chart is simpler but less efficient. For several correlated variables at once, see the MEWMA chart.
How it works
Start from the process mean μ₀ (a target or the mean of a stable baseline) and the short-term standard deviation σ (for individual values, MR̄/1.128 from a stable period). Choose the weight λ (between 0 and 1) and the limit width L. Then, with z₀ = μ₀:
zᵢ = λxᵢ + (1 − λ)zᵢ₋₁The variance of zᵢ grows with i and settles at λ/(2 − λ) times the variance of x. The limits follow it:
UCLᵢ = μ₀ + Lσ √( λ/(2 − λ) · [1 − (1 − λ)²ⁱ] )
LCLᵢ = μ₀ − Lσ √( λ/(2 − λ) · [1 − (1 − λ)²ⁱ] )After a few points the bracket is close to 1 and the limits become constant at μ₀ ± Lσ√(λ/(2 − λ)). For subgroup means, replace σ with σ/√n.
Small λ (0.05 to 0.1) gives long memory and the best sensitivity to very small shifts; larger λ (0.2 to 0.4) reacts faster to bigger shifts. With λ = 1 the EWMA is just an individuals chart. A common default is λ = 0.2 with L = 3. In a simulation of 40,000 runs for this article, that pair gave an in-control average run length of about 560 points, and detected a sustained 1σ shift after about 10 points on average; an individuals chart with Test 1 needs about 44.
Use only Test 1. Consecutive EWMA values are strongly correlated by design, so runs and zone patterns from the tests for special causes do not have their usual meaning. The NIST/SEMATECH e-Handbook describes the same chart.
Example
A nickel electroplating line keeps its bath at 80.0 g/L of nickel. A technician titrates a sample twice per shift. From a stable month, σ = MR̄/1.128 = 1.2 g/L. The team uses λ = 0.2 and L = 3, so the limits settle at 80.0 ± 3 × 1.2 × √(0.2/1.8) = 80.0 ± 1.2 g/L. The last 20 analyses (g/L):
| 1–5 | 6–10 | 11–15 | 16–20 |
|---|---|---|---|
| 80.1, 80.5, 80.6, 81.4, 78.7 | 79.4, 79.4, 78.6, 81.3, 79.2 | 79.5, 80.5, 79.3, 79.9, 79.2 | 80.1, 79.0, 77.4, 78.0, 78.1 |
- z₁ = 0.2 × 80.1 + 0.8 × 80.0 = 80.020. Its limits are 80.0 ± 3 × 1.2 × √(0.2/1.8 × (1 − 0.8²)) = 80.0 ± 0.72.
- z₂ = 0.2 × 80.5 + 0.8 × 80.020 = 80.116, with limits 80.0 ± 0.92.
- z₂₀ = 78.767, with limits 80.0 ± 1.20, so the LCL is 78.800.
The EWMA crosses its lower limit at analysis 20. On an individuals chart with limits 76.4 to 83.6 g/L, none of the 20 values is out, and none of the eight tests has fired. Analyses 13 to 20 average 78.9 g/L, about 0.9σ below target. A new rack design introduced that week carried more solution out of the tank at each cycle, and the nickel additions had not been increased to match. The replenishment rate was raised.
How to read the results
- A point beyond the limits means the recent weighted average has moved. The shift may have started several points earlier; look back to where the EWMA began to trend.
- The EWMA's direction is informative. A steady slope toward a limit is a drift; a jump followed by a plateau is a step change.
- Single spikes are damped. One bad value moves the EWMA by only λ times its deviation, so keep an individuals chart for large upsets.
- After a signal and a correction, restart the EWMA at μ₀ so the old data no longer pull on it.
Common mistakes
- Using the asymptotic limits from the first point. Early EWMA values vary less, so the exact limits start narrower; using the wide asymptotic limits from the start makes early shifts harder to see.
- Estimating σ from the EWMA values. σ must describe the individual observations, not the smoothed ones.
- Reading run rules. A smooth EWMA naturally stays on one side of the center line for many points.
- Choosing λ and L after looking at the data. Pick them before charting, based on the size of shift you need to catch.
Frequently asked questions
How do I choose λ and L?
Decide the smallest shift worth detecting. For shifts around 1σ, λ between 0.1 and 0.2 with L near 3 (or slightly less for λ = 0.1) is a common choice. Smaller λ suits smaller shifts. Published tables and simulations give the average run lengths for each pair.
Why do the limits widen at the start?
The first EWMA value is mostly the starting value μ₀, so it varies little. As more observations enter, the variance of zᵢ grows toward its steady value, and the limits widen with it.
What is the difference between EWMA and CUSUM?
Both accumulate evidence over time and detect small shifts well. The EWMA plots a smoothed estimate of the current mean, which is easy to interpret. The CUSUM accumulates deviations beyond an allowance and is slightly better tuned to one specific shift size.
Can I use EWMA with subgroups?
Yes. Use the subgroup means as xᵢ and σ/√n in the limit formula, with σ the within-subgroup standard deviation.