Bayesian SPC

Same data. Classical SPC flags issues.
Bayesian SPC explains why.

180 bore diameter measurements from a real CNC machining process. Classical analysis flags out-of-control points. Bayesian analysis decomposes what’s driving them and what to do about it.

Dataset:Bore Diameter
n =180 obs
Target:25.000 mm
Spec:24.95 - 25.05
Lots:4
Operators:2
Machine:CNC-04

What Classical SPC Shows

Shewhart charts + point-estimate capability
Capability
Cpk = 1.71
Passes 1.33 threshold — but 6 of 36 subgroups are out of control
Cpk
1.71
Point estimate
Cp
1.74
Point estimate
25.001
Grand mean
σw
0.0096
R̄/d₂ (within)
X̄ Control Chart — 36 subgroups (n=5 each)
UCL 25.014 25.001 LCL 24.988 3 consecutive OOC Subgroups 1–36 • 6 out-of-control points flagged
  • Cpk = 1.71 exceeds 1.33 threshold. Capability passes.
  • !
    6 of 36 subgroup means outside control limits — process is not in statistical control.
  • !
    Run of 3 consecutive points above UCL (SG14-16). Followed by a drop below LCL (SG17). Classical tools flag these but can’t explain why.
  • Recommendation: Investigate OOC points. Capability passes but the process isn’t stable.
+

What Bayesian SPC Adds

Bayesian Cpk + BOCPD + lot segmentation + Taguchi loss
Health Score
2 of 4 lots fail Cpk > 1.33
LOT-001 Cpk = 1.14, LOT-002 Cpk = 1.08 — pooling masked the failures
LOT-001 Cpk
1.14
n=80, below threshold
LOT-002 Cpk
1.08
n=60, below threshold
Shift detected
Obs 66
Mean +0.024mm
Regime 2 loss
$0.28
8.5× baseline $/unit
Individual Values — lot-colored with BOCPD changepoints
25.000 LOT-001 LOT-002 LOT-003 LOT-004 SHIFT +0.024mm
Per-Lot Bayesian Capability
LotObsCpkσStatus
LOT-0011–801.140.0131Shift at obs 66 — fails 1.33
LOT-00281–1401.080.0127Below threshold
LOT-003141–1602.470.0064Excellent — but n=20
LOT-004161–1801.800.0074Passes — but n=20
Taguchi Loss Decomposition per Regime
Regime 1 (obs 1–65)$0.033/unit
Regime 2 (obs 66–80) ← post-shift$0.280/unit
Regime 3 (obs 81–140)$0.095/unit
Regime 4 (obs 141–180)$0.040/unit
Bias (off-target) Variance (spread)
  • +
    LOT-001 (Cpk 1.14) and LOT-002 (Cpk 1.08) both fall below the 1.33 threshold. Pooling across lots inflated the overall Cpk to 1.71.
  • !
    Mean shift of +0.024mm detected at obs 66 (late LOT-001). Classical SPC flagged the OOC points but couldn’t attribute them to a specific cause. BOCPD pinpoints the timing.
  • +
    Post-shift regime (obs 66–80): $0.280/unit Taguchi loss, 85% from bias. 8.5× worse than baseline. The corrective action is to re-center, not tighten tolerances.
  • !
    LOT-003/004 show excellent capability (Cpk 2.47/1.80) but each has only n=20 — posteriors are wide. 30 more observations would narrow the credible interval by ~36%.
  • +
    Recommendation: Investigate the obs 66 shift (tool wear? fixture drift?). Quarantine LOT-001/002 material for review. Collect more data on LOT-003/004 to confirm capability.

What Bayesian SPC adds to your analysis

1
Segment-level visibility

Classical SPC computes one Cpk = 1.71 from all 180 observations, mixing four material lots with very different behavior. Bayesian SPC segments by lot and finds LOT-001 at 1.14 and LOT-002 at 1.08 — both below threshold. Pooling masked two failing lots.

2
Honest uncertainty

LOT-003 shows Cpk = 2.47 — impressive, until you note it’s based on only 20 observations. The posterior credible interval is wide. Bayesian SPC quantifies this uncertainty instead of hiding it behind a point estimate. More data would shrink the CI by ~36%.

3
Structured shift detection

Classical SPC flagged 6 OOC subgroups — but what caused them? BOCPD pinpoints the shift at observation 66: a +0.024mm mean shift in late LOT-001, likely tool wear or fixture drift. The classical chart sees the symptoms. Bayesian analysis structures the diagnosis.

4
Loss decomposition

Classical SPC gives you in-spec or out-of-spec. Taguchi Loss quantifies cost per unit and decomposes it into bias (off-center) vs variance (spread). The post-shift regime costs $0.280/unit — 8.5× baseline — and 85% is bias. That tells you to re-center, not tighten tolerances.

Try Bayesian SPC on your own data

Upload your process data and get per-lot capability posteriors, changepoint detection, and Taguchi loss analysis. Free tier available.

Start Free Try Bayesian Cpk Calculator

Frequently Asked Questions

What is Bayesian SPC?
Bayesian SPC extends classical Statistical Process Control by using probability distributions instead of point estimates. Instead of a single Cpk number, you get the full posterior probability that your process meets capability requirements — P(Cpk > 1.33), for example. This reveals uncertainty that point estimates hide, especially with small sample sizes or mixed-lot data.
Does Bayesian SPC replace classical SPC?
No. Bayesian SPC builds on classical SPC. Shewhart charts remain the foundation for real-time monitoring. Bayesian methods add a deeper analysis layer: honest uncertainty quantification, changepoint detection, per-segment capability, and loss decomposition. Use both together for the complete picture.
What is BOCPD?
Bayesian Online Changepoint Detection (BOCPD) continuously estimates the probability that a process regime shift has occurred at each observation. In the bore diameter example above, BOCPD pinpoints the +0.024mm mean shift at observation 66 — which classical SPC also detected (as OOC points), but without attributing it to a specific regime transition or quantifying the shift magnitude.
What is Taguchi Loss?
The Taguchi Loss Function quantifies the economic cost of deviation from target, even when parts are within specification. It decomposes loss into bias (how far off-center) and variance (how much spread), which tells you whether to re-center the process or reduce variability — two very different corrective actions.
Can I try this on my own data?
Yes. Svend's SPC module includes Bayesian Cpk analysis, BOCPD changepoint detection, and Taguchi loss decomposition. The free tier includes 5 analyses per day. You can also try the Bayesian Cpk Calculator right now with no account required.