Statistical process control for fuel tracking: detecting real change vs. noise

A fill-up log answers "what is my MPG" but not "is my MPG changing" or "is that change real". Statistical process control is the methodology that answers both. It was developed for manufacturing quality control, and it applies to a fill-up log the same way it applies to a production line.

What you get from SPC that the fill-up method does not give you

The fill-up method (covered on the calculation guide) gives you a per-fill-up MPG. The math page covers how to average across fill-ups, and the factors guide covers what moves the result. What neither covers is the harder question: when your MPG moves, is it a real change (an aging sensor, a dragging brake, a fuel-quality problem) or is it just the noise of measurement?

Statistical process control is the methodology that distinguishes the two. It was developed by Walter Shewhart at Bell Labs in the 1920s for exactly this kind of "is the process different than it was" question, and it has been the standard quality-engineering tool in manufacturing ever since. The same logic applies to a fill-up log: the MPG varies from fill-up to fill-up, the question is whether the variation is the normal noise of measurement or a signal that something changed.

Building an Individuals and Moving Range chart

The simplest SPC chart for individual measurements is the I-MR chart (Individuals and Moving Range). You plot each MPG measurement as a point, and below it you plot the moving range (the absolute difference between consecutive points). The centre line of the individuals chart is the grand mean; the centre line of the moving-range chart is the mean of the moving ranges. The control limits are calculated as ±3σ, where σ is estimated from the average moving range using the formula σ = MR-bar / 1.128 (the d2 constant for n=2).

In practice, the easiest way to build an I-MR chart is in a spreadsheet or a few lines of Python:

import statistics

mpg = [28.4, 29.1, 27.9, 28.7, 28.2, 29.5, 27.1, 26.8, 28.9, 28.3, 27.6, 28.5]

# Moving ranges
mr = [abs(mpg[i] - mpg[i-1]) for i in range(1, len(mpg))]
mean_mpg = statistics.mean(mpg)
mean_mr = statistics.mean(mr)
sigma = mean_mr / 1.128

ucl_i = mean_mpg + 3 * sigma
lcl_i = mean_mpg - 3 * sigma
ucl_mr = mean_mr * 3.268 # D4 constant for n=2

print(f'Mean MPG: {mean_mpg:.2f}')
print(f'Sigma: {sigma:.3f}')
print(f'UCL (I): {ucl_i:.2f}')
print(f'LCL (I): {lcl_i:.2f}')
print(f'UCL (MR): {ucl_mr:.2f}')

The output for the sample data is a mean of 28.25 MPG, a sigma estimate of 0.93, and 3σ control limits at 31.04 and 25.46. No point violates the individuals chart, so the process is in statistical control. If a future fill-up drops to 24.5 MPG, that would be a special-cause signal worth investigating.

Why SPC and Not Just Averages

A simple running average of MPG across fill-ups will tell you whether your fuel economy has changed over time, but it will not tell you why it changed, and it will not tell you whether the change is real or whether it falls within the natural noise of measurement. Statistical process control is the formal quality-engineering discipline that answers both questions. It was developed by Walter Shewhart at Bell Labs in the 1920s, formalised in the Western Electric Statistical Quality Control Handbook in 1956, and codified internationally in ISO 22514-2 and the older ISO 8258 (Shewhart control charts). Today it is used in every modern manufacturing environment and is more being applied to operational data outside the factory, including vehicle fleets.

The core idea is simple: every measurement process has an inherent variability, called common-cause variation, that you cannot eliminate without changing the system. As long as your data shows only common-cause variation, the process is "in control" and any future result is predictable within a known range. When a new source of variability, a new driver, a new fuel batch, a new route, a faulty sensor, appears, it shows up as a special-cause pattern that breaks the rules of common-cause variation. SPC gives you a principled way to detect the special cause and fix it, rather than chasing random noise.

Building an Individuals and Moving Range Chart

The simplest SPC chart for individual measurements is the I-MR chart (Individuals and Moving Range). You plot each MPG measurement as a point, and below it you plot the moving range (the absolute difference between consecutive points). The centre line of the individuals chart is the grand mean; the centre line of the moving-range chart is the mean of the moving ranges. The control limits are calculated as ±3σ, where σ is estimated from the average moving range using the formula σ = MR-bar / 1.128 (the d2 constant for n=2).

In practice, the easiest way to build an I-MR chart is in a spreadsheet or a few lines of Python:

import statistics

mpg = [28.4, 29.1, 27.9, 28.7, 28.2, 29.5, 27.1, 26.8, 28.9, 28.3, 27.6, 28.5]

# Moving ranges
mr = [abs(mpg[i] - mpg[i-1]) for i in range(1, len(mpg))]
mean_mpg = statistics.mean(mpg)
mean_mr = statistics.mean(mr)
sigma = mean_mr / 1.128

ucl_i = mean_mpg + 3 * sigma
lcl_i = mean_mpg - 3 * sigma
ucl_mr = mean_mr * 3.268 # D4 constant for n=2

print(f'Mean MPG: {mean_mpg:.2f}')
print(f'Sigma: {sigma:.3f}')
print(f'UCL (I): {ucl_i:.2f}')
print(f'LCL (I): {lcl_i:.2f}')
print(f'UCL (MR): {ucl_mr:.2f}')

The output for the sample data is a mean of 28.25 MPG, a sigma estimate of 0.93, and 3σ control limits at 31.04 and 25.46. No point violates the individuals chart, so the process is in statistical control. If a future fill-up drops to 24.5 MPG, that would be a special-cause signal worth investigating.

Western Electric Rules for Pattern Recognition

Shewhart's 3σ rule is the most famous SPC rule, but it is not the only one. The Western Electric Handbook, written in 1956 to standardise SPC training at Western Electric's Hawthorne Works, codified four additional rules that catch non-random patterns even when no single point crosses the 3σ line. The most useful ones for fuel-tracking are:

  • Rule 1 (3σ): Any single point outside the 3σ limits.
  • Rule 2 (nine-in-a-row): Nine consecutive points on the same side of the centre line. Indicates a sustained shift, often caused by a slow drift such as a clogged air filter or a fuel-quality change.
  • Rule 3 (six-trend): Six consecutive points all trending up or all trending down. Indicates a progressive change, often caused by a part wearing in (or out).
  • Rule 4 (two-of-three): Two out of three consecutive points beyond the 2σ limit on the same side. An early-warning signal that Rule 1 is about to fire.

For fleet operators tracking hundreds of vehicles, automated SPC software (Minitab, JMP, the open-source spc package for R, or the spc-chart Python module) can run all four rules continuously and alert when a vehicle is drifting out of control.

Process Capability Indices (Cp, Cpk, Pp, Ppk)

Once you have a stable process, the next question is whether it is capable, whether it can consistently meet the specification limits you have set. For fuel economy, the specification is typically a one-sided limit ("at least 25 MPG under the standard driving cycle") or a two-sided range ("between 28 and 32 MPG under cruise conditions"). The capability indices quantify how much "headroom" the process has.

Cp compares the width of the specification to the width of the process: Cp = (USL − LSL) / 6σ. A Cp of 1.00 means the process just barely fits; a Cp of 1.33 or higher is generally considered capable. Cpk is the same calculation adjusted for off-centre processes: Cpk = min((USL − μ) / 3σ, (μ − LSL) / 3σ). The distinction between Cp and Cpk is critical for fuel tracking because a fleet that has improved on average but has wider variability may have a higher Cp and a lower Cpk than a fleet that has not improved but is more consistent.

Pp and Ppk are the same calculations but use the overall standard deviation (computed across the whole dataset) rather than the within-subgroup standard deviation. They measure long-term capability, while Cp and Cpk measure short-term capability. For vehicle fleets, Cpk is usually the more useful number because it tells you whether the immediate operating state of each vehicle is within spec.

Practical Limitations in Real-World Fuel Tracking

SPC was developed for manufacturing, where the measurement is taken under controlled conditions on a fixed schedule. Vehicle fuel tracking is messier: fill-ups happen at irregular intervals, the odometer reading has measurement error, the fuel pump has measurement error, ambient conditions change, and the driving pattern varies day to day. None of this invalidates SPC, but it does mean that you should not apply the control limits blindly. A common adjustment is to widen the limits by a factor that reflects the measurement-system uncertainty, calculated using a Gauge R&R study. A second common adjustment is to use a moving baseline rather than a fixed grand mean, so that slow improvements (a driver who has learned to anticipate traffic, a fleet that has switched to synthetic oil) do not trigger spurious "out of control" signals.