Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
the residuals guide.

### Changed
- **Manual citations follow the 11-7 edition.** Dr. Bishop's manual of 2026-11-07 has 20 chapters
(chapters 7 and up are one lower than before) and dot-numbered captions; every equation and
chapter citation in the code, docs and tests now uses its numbering, in the hyphen form the
manual repository checks ("11-7 manual Eq 13-8"). Seven equations it removed are cited by
their replacements. No behaviour changes.
- **mR charts check Rule 1 only by default.** Wheeler reads the moving range chart for points
above its upper limit. The zone and run rules assume symmetric, independent points, and
successive moving ranges share a reading, so with all eight rules on, 95% of 100-point
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ compares outputs, not prose.
## Citing the methodology

Code and docs cite Bishop's VAS documentation manual by edition and equation number:
`(10-12 manual Eq 14-8)`, `Eqs 14-4..14-13`, `Eqs 11-16/17`. Name the edition once per file and use
`(11-7 manual Eq 13-8)`, `Eqs 13-4..13-13`, `Eqs 10-16/17`. Name the edition once per file and use
the chapter-number form; `tests/test_manual_citations.py` checks both. The citations are read
against the manual itself, so a new edition reports every place in the library whose equation
changed or moved.
Expand Down
8 changes: 4 additions & 4 deletions docs/appendix/wheeler-terminology.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,11 @@ Wheeler uses the standard SPC constants from Shewhart's work:

| Constant | Purpose | Formula Source |
|----------|---------|----------------|
| c₄ | Unbiasing s | Related to gamma function; Bishop's α<sub>N</sub> (10-12 manual Eqs 10-11, 10-12) |
| c₄ | Unbiasing s | Related to gamma function; Bishop's α<sub>N</sub> (11-7 manual Eqs 9-8, 9-9) |
| A₃ | Xbar limits from s | 3 / (c₄√n) |
| B₃, B₄ | S chart limits | Functions of c₄ and n (Eqs 10-14, 11-8, 11-9) |
| d₂ | Unbiasing range | Tabulated; 1.128 for moving ranges of two (Eqs 12-2, 12-4) |
| D₃, D₄ | mR chart limits | Functions of d₂ and d₃; D₄ = 1 + 3(0.8525)/1.128 for moving ranges of two (Eq 12-5) |
| B₃, B₄ | S chart limits | Functions of c₄ and n (Eqs 9-11, 10-8, 10-9) |
| d₂ | Unbiasing range | Tabulated; 1.128 for moving ranges of two (Eqs 11-2, 11-4) |
| D₃, D₄ | mR chart limits | Functions of d₂ and d₃; D₄ = 1 + 3(0.8525)/1.128 for moving ranges of two (Eq 11-5) |

---

Expand Down
18 changes: 9 additions & 9 deletions docs/reference/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ From `study.capability()`. Fields include `pp`, `ppk` (with `ppk_lower`/`ppk_upp
`stability_warning`, and the capability `window` when one was requested.

- `sigma_hat_r2` — S<sub>R2</sub> / c4(N<sub>R2</sub>), the potential σ̂ from R2
(10-12 manual Eq 16-10).
(11-7 manual Eq 15-10).
- `potential_center` — the mean of the potential values ȳ + R2, i.e. ȳ + mean(R2).
Potential CPL/CPU are measured from it and the potential chart's center line sits
there; it equals `y_bar` in ADS 1. `None` when potential capability is unavailable.
Expand All @@ -445,10 +445,10 @@ From `study.loss_function()`. Taguchi loss decomposition: `centering`,
counterparts, `pdc_by_factor`, and the `target` used (`target_is_default` says
whether it was derived).

`unexplained` is the average cell variance in ADS 1 (10-12 manual Eq 15-16) and the
sample variance of R2 in ADS 2/3 (Eq 15-17). `interaction` is the average squared
`unexplained` is the average cell variance in ADS 1 (11-7 manual Eq 14-14) and the
sample variance of R2 in ADS 2/3 (Eq 14-15). `interaction` is the average squared
interaction effect in ADS 1; in ADS 2/3 it is what the other parts leave of
(Ȳ − T)² + S², set to 0 if negative (Eqs 15-18..15-20), so there `total` equals
(Ȳ − T)² + S², set to 0 if negative (Eqs 14-16..14-18), so there `total` equals
(Ȳ − T)² + S² unless the interaction was set to 0. `loss_function()` raises
`ValidationError` when R2 is unavailable for the layout.

Expand All @@ -467,8 +467,8 @@ loss.plot(*, structured=False, orientation='vertical', theme=None,

From `study.maximum_information()`. Fields: `n`, `r2_mean`, `r2_mR`,
`sigma_hat`, `upl`, `lpl`, `n_signals`. An X chart of R2: limits
`r2_mean ± (3/1.128)·r2_mR`, `sigma_hat = r2_mR / 1.128` (10-12 manual Eqs 12-4, 12-10,
12-11). Raises
`r2_mean ± (3/1.128)·r2_mR`, `sigma_hat = r2_mR / 1.128` (11-7 manual Eqs 11-4, 11-8,
11-9). Raises
`ValidationError` when R2 is unavailable for the layout.

```python
Expand Down Expand Up @@ -614,9 +614,9 @@ Secondary surface. The control-chart constants are functions of subgroup size:
```python
from processbehavior.spc_constants import c4, b3, b4, VALID_BASE_CHARTS

c4(n) # bias-correction factor for s (10-12 manual Eqs 10-11, 10-12); exact for every n
b3(n, sigma_multiplier=3) # S-chart lower-limit factor (Eqs 10-14, 11-8)
b4(n, sigma_multiplier=3) # S-chart upper-limit factor (Eqs 10-14, 11-9)
c4(n) # bias-correction factor for s (11-7 manual Eqs 9-8, 9-9); exact for every n
b3(n, sigma_multiplier=3) # S-chart lower-limit factor (Eqs 9-11, 10-8)
b4(n, sigma_multiplier=3) # S-chart upper-limit factor (Eqs 9-11, 10-9)
VALID_BASE_CHARTS # {'Histogram', 'Xbar', 'S', 'X', 'mR'}
```

Expand Down
14 changes: 7 additions & 7 deletions docs/reference/sds_definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ For background on the lineage itself (Planned → Observed → Analytical), see
- **Grid Status**: Semi-Complete
- **Description**: Every (factor × time) cell has exactly 1 observation
- **Implications**:
- No within-cell variance: R2 is estimated from the condition-and-period-adjusted series, differenced along the condition-then-time sequence and scaled by the R2 scale factor (Eqs 14-4..14-8)
- No within-cell variance: R2 is estimated from the condition-and-period-adjusted series, differenced along the condition-then-time sequence and scaled by the R2 scale factor (Eqs 13-4..13-8)
- Interaction effects confounded with pure error
- VAS residuals available when the R2 scale factor is defined: at least 2 process design conditions and M ≥ K + 2 observations (see [R2 calculation](#r2-calculation-methods-by-ds))
- Common in unreplicated factorial designs
Expand All @@ -52,7 +52,7 @@ For background on the lineage itself (Planned → Observed → Analytical), see
- **Grid Status**: Semi-Complete
- **Description**: Mix of cells - some have n=1, others have n≥2
- **Implications**:
- R2 by the same scaled difference as DS 2, over every observation (Eqs 14-9..14-13); any one-observation cell selects `ma2` for every observation
- R2 by the same scaled difference as DS 2, over every observation (Eqs 13-9..13-13); any one-observation cell selects `ma2` for every observation
- Xbar/S is the default chart
- **Most common in real-world data**
- Partial interaction effect estimation
Expand Down Expand Up @@ -123,12 +123,12 @@ Equation numbers refer to Bishop's VAS documentation manual dated 10-12-2026.
| DS | R2 Method | Description |
|-----|-----------|-------------|
| 0 | N/A | No VAS decomposition |
| 1 | Exact (within-cell) | `R2 = Y - Ȳ_kt` (Eq 14-3) |
| 2 | Scaled difference (`ma2`) | Condition-and-period-adjusted series, differenced and divided by 2·c(K, M), M = KT (Eqs 14-4..14-8) |
| 3 | Scaled difference (`ma2`) | Any one-observation cell: the same over every observation (Eqs 14-9..14-13) |
| 1 | Exact (within-cell) | `R2 = Y - Ȳ_kt` (Eq 13-3) |
| 2 | Scaled difference (`ma2`) | Condition-and-period-adjusted series, differenced and divided by 2·c(K, M), M = KT (Eqs 13-4..13-8) |
| 3 | Scaled difference (`ma2`) | Any one-observation cell: the same over every observation (Eqs 13-9..13-13) |
| 4 | Exact (present cells) | Collapses to ADS 1 after cleaning; within-cell for available data |
| 5 | Scaled difference (`ma2`) | Collapses to ADS 2 after cleaning; all present cells are unreplicated (Eqs 14-9..14-13) |
| 6 | Scaled difference (`ma2`) | Collapses to ADS 3 after cleaning (Eqs 14-9..14-13) |
| 5 | Scaled difference (`ma2`) | Collapses to ADS 2 after cleaning; all present cells are unreplicated (Eqs 13-9..13-13) |
| 6 | Scaled difference (`ma2`) | Collapses to ADS 3 after cleaning (Eqs 13-9..13-13) |

The scaled difference first removes the process mean and the condition and period effects,
Z = Y − Ȳ_k − Ȳ_t + Ȳ (unweighted means of cell means), then differences Z along the
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ effects). It is a report, not a gate. CI runs it on every push and keeps its out

- The limits of the two factor S charts (pages 25 and 27) in the known-effects run, whose
subgroups have 1000 and 2000 values. Its VAS run of 6 October 2026 held α<sub>N</sub>
(10-12 manual Eq 10-11) at 0.9995 from N = 343 up, where Minitab's GAMMA function overflows,
(11-7 manual Eq 9-8) at 0.9995 from N = 343 up, where Minitab's GAMMA function overflows,
so its limits follow N = 500 instead of the subgroup's own N. Dr. Bishop's reruns of the PM
runs (13 October 2026) compute α<sub>N</sub> for every N, and every R6 S chart in them is
checked and matches; the known-effects run waits for the same rerun.
Expand Down
16 changes: 8 additions & 8 deletions docs/tutorials/loss-function.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"source": [
"# Taguchi Loss Function Analysis\n",
"\n",
"Process behavior charts answer *\"Is this process stable?\"* The Taguchi Loss Function (Bishop Chapter 15) answers a different question: *\"Where is the variation coming from, and how much does each source contribute to expected loss?\"*\n",
"Process behavior charts answer *\"Is this process stable?\"* The Taguchi Loss Function (Bishop Chapter 14) answers a different question: *\"Where is the variation coming from, and how much does each source contribute to expected loss?\"*\n",
"\n",
"It decomposes the expected squared loss into **5 components**:\n",
"\n",
Expand Down Expand Up @@ -2304,7 +2304,7 @@
"\n",
"## DS 2: ADS 2/3 Unexplained and Interaction\n",
"\n",
"DS 2 has singleton cells, so there is no within-cell spread to average. The unexplained component is the sample variance of R2 (10-12 manual Eq 15-17), and the interaction is what the other four components leave of the total loss $(\\bar{Y}_{..} - T)^2 + S^2$, set to 0 if negative (Eqs 15-18 to 15-20). With one observation per subgroup, interaction and noise cannot be separated cell by cell, so the interaction is backed out of the total rather than estimated directly:"
"DS 2 has singleton cells, so there is no within-cell spread to average. The unexplained component is the sample variance of R2 (11-7 manual Eq 14-15), and the interaction is what the other four components leave of the total loss $(\\bar{Y}_{..} - T)^2 + S^2$, set to 0 if negative (Eqs 14-16 to 14-18). With one observation per subgroup, interaction and noise cannot be separated cell by cell, so the interaction is backed out of the total rather than estimated directly:"
]
},
{
Expand Down Expand Up @@ -2503,9 +2503,9 @@
"\n",
"## The Equations\n",
"\n",
"For reference, here are the Bishop Chapter 15 equations implemented by `loss_function()`:\n",
"For reference, here are the Bishop Chapter 14 equations implemented by `loss_function()`:\n",
"\n",
"**Expected Loss Decomposition** (Eq. 15-13):\n",
"**Expected Loss Decomposition** (Eq. 14-13):\n",
"\n",
"$$EL = (\\bar{Y}_{..} - T)^2 + \\hat{\\sigma}^2_w + \\frac{1}{K}\\sum_k \\rho_k^2 + \\frac{1}{T}\\sum_t \\tau_t^2 + \\frac{1}{KT}\\sum_{k,t} (\\rho\\tau)_{kt}^2$$\n",
"\n",
Expand All @@ -2514,18 +2514,18 @@
"| Term | Component | Equation |\n",
"|------|-----------|----------|\n",
"| $(\\bar{Y}_{..} - T)^2$ | Centering | Squared distance from grand mean to target |\n",
"| $\\hat{\\sigma}^2_w$ | Unexplained | Noise variance (Eq. 15-16 / 15-17) |\n",
"| $\\frac{1}{K}\\sum_k \\rho_k^2$ | PDC | Mean squared PDC effect (Eq. 15-22) |\n",
"| $\\hat{\\sigma}^2_w$ | Unexplained | Noise variance (Eq. 14-14 / 14-15) |\n",
"| $\\frac{1}{K}\\sum_k \\rho_k^2$ | PDC | Mean squared PDC effect (Eq. 14-20) |\n",
"| $\\frac{1}{T}\\sum_t \\tau_t^2$ | Time | Mean squared time effect |\n",
"| $\\frac{1}{KT}\\sum_{k,t} (\\rho\\tau)_{kt}^2$ | Interaction | Mean squared PDC x time interaction (DS 1/4); remainder (DS 2/3/5/6) |\n",
"\n",
"Equation numbers are those of Bishop's VAS manual dated 10-12-2026.\n",
"\n",
"**Replicated cells** (ADS 1, Eq. 15-16) — the average cell variance:\n",
"**Replicated cells** (ADS 1, Eq. 14-14) — the average cell variance:\n",
"\n",
"$$\\hat{\\sigma}^2_w = \\frac{1}{KT}\\sum_{k,t} S_{kt}^2$$\n",
"\n",
"**Singleton cells** (ADS 2/3) — the variance of R2 (Eq. 15-17), and the interaction as the remainder of the total loss (Eqs. 15-18 to 15-20), floored at 0:\n",
"**Singleton cells** (ADS 2/3) — the variance of R2 (Eq. 14-15), and the interaction as the remainder of the total loss (Eqs. 14-16 to 14-18), floored at 0:\n",
"\n",
"$$\\hat{\\sigma}^2_w = S_{R2}^2 \\qquad EL_{PDC\\times PT} = \\max\\left(S^2 - \\frac{1}{K}\\sum_k \\rho_k^2 - \\frac{1}{T}\\sum_t \\tau_t^2 - S_{R2}^2,\\ 0\\right)$$\n",
"\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/process-capability.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"\n",
"Process capability answers a different question from process behavior charts. Charts ask *\"Is this process stable?\"* Capability asks *\"Can this process consistently meet specifications?\"*\n",
"\n",
"Wheeler & Bishop (Chapter 16) define two families of capability indices:\n",
"Wheeler & Bishop (Chapter 15) define two families of capability indices:\n",
"\n",
"| Index | Measures | Based on |\n",
"|-------|----------|----------|\n",
Expand Down Expand Up @@ -1703,7 +1703,7 @@
"source": [
"## The Equations\n",
"\n",
"For reference, here are the Bishop Chapter 16 equations implemented by `capability()`:\n",
"For reference, here are the Bishop Chapter 15 equations implemented by `capability()`:\n",
"\n",
"**Current Capability** (overall sigma):\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/sds-validation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -73055,7 +73055,7 @@
"---\n",
"## PM SDS 3: Full Validation Against Bishop's Reference\n",
"\n",
"This section replicates Tom Bishop's VAS analysis of PM SDS 3 — an SDS 3 (Partial Replication) dataset with a mix of n=1 and n≥2 cells — against his VAS run of 3 October 2026 (for the 10-1-2026 manual). In that manual Xbar/S is VAS's default chart for SDS 3, so the original data and the interaction are charted as Xbar/S. We validate each chart against Bishop's reference output.\n",
"This section replicates Tom Bishop's VAS analysis of PM SDS 3 — an SDS 3 (Partial Replication) dataset with a mix of n=1 and n≥2 cells — against his VAS run of 3 October 2026 (for the 11-7 manual). In that manual Xbar/S is VAS's default chart for SDS 3, so the original data and the interaction are charted as Xbar/S. We validate each chart against Bishop's reference output.\n",
"\n",
"Spec limits: **LSL = 232, USL = 242, Target = 237**"
]
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/staged-charts.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7291,7 +7291,7 @@
"source": [
"Each stage is computed as a separate analysis. Its center is the unweighted mean of its subgroup\n",
"means, its S̄ is the mean of its subgroup standard deviations, and its σ̂ and limits follow from those\n",
"(10-12 manual Eqs 11-5, 11-8, 11-9, 11-16, 11-17). Nothing is pooled across stages, so each stage is\n",
"(11-7 manual Eqs 10-5, 10-8, 10-9, 10-16, 10-17). Nothing is pooled across stages, so each stage is\n",
"judged against its own data."
]
},
Expand Down
12 changes: 6 additions & 6 deletions docs/user-guide/chart-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ staged.phase_statistics('Xbar') # one row per stage: center, S-bar, sigma-hat,

Each stage is computed as a separate analysis, exactly as `by=[time]` computes one chart
per stage: its center is the unweighted mean of its subgroup means, its S̄ is the mean of its
subgroup standard deviations, and its σ̂ and limits follow from those (10-12 manual Eqs 11-5,
11-8, 11-9, 11-16, 11-17). Nothing is pooled across stages. On Wheeler's four-cavity
subgroup standard deviations, and its σ̂ and limits follow from those (11-7 manual Eqs 10-5,
10-8, 10-9, 10-16, 10-17). Nothing is pooled across stages. On Wheeler's four-cavity
thickness data, with the cavity as the stage, the per-cavity centers and limits match
Minitab's staged Xbar-S chart to the digit; the per-cavity charts of `by=['Hour']` give the
same numbers, one chart at a time.
Expand Down Expand Up @@ -314,16 +314,16 @@ factor pooled or charted on its own.

Plots each individual observation.

- **Centerline**: Average of all observations (X̅) (10-12 manual Eqs 12-7, 12-9)
- **Control Limits**: X̅ ± (3/1.128) × R̅, about X̅ ± 2.66 × R̅ (R̅ is the average of the T − 1 moving ranges; Eqs 12-1, 12-10, 12-11)
- **Centerline**: Average of all observations (X̅) (11-7 manual Eq 11-7)
- **Control Limits**: X̅ ± (3/1.128) × R̅, about X̅ ± 2.66 × R̅ (R̅ is the average of the T − 1 moving ranges; Eqs 11-1, 11-8, 11-9)
- **Interpretation**: Points beyond limits indicate special causes

### The mR (Moving Range) Chart

Plots the absolute difference between consecutive observations.

- **Centerline**: Average moving range (R̅)
- **UCL**: (1 + 3 × 0.8525/1.128) × R̅, about 3.267 × R̅ (10-12 manual Eq 12-5)
- **UCL**: (1 + 3 × 0.8525/1.128) × R̅, about 3.267 × R̅ (11-7 manual Eq 11-5)
- **LCL**: 0 (range cannot be negative)
- **Interpretation**: Large ranges indicate sudden changes

Expand Down Expand Up @@ -443,7 +443,7 @@ result = study.execute(chart='X', by=['lane'], value='R4')
result = study.execute(chart='X', by=['lane'], value='R4', recentered=True)
```

Re-centering adds back the grand mean, RCR = R + Y̅ (Bishop's 10-12 manual, Eq 14-26, for R1
Re-centering adds back the grand mean, RCR = R + Y̅ (Bishop's 11-7 manual, Eq 13-26, for R1
and R3–R6), so a re-centered chart plots the effect plus R2 on the measurement scale. The
chart shifts by Y̅; the limit width is unchanged. RCR2 is the exception: Y̅_kt + R2. Chart
period effects from R4; an Xbar of RCR3 by period is flat, because the interaction sums to
Expand Down
Loading
Loading