pub struct CapabilityIndices {}Expand description
Computed capability indices.
Fields are Option<f64> because not every index can be computed for
every input. Cp requires both USL and LSL; the short-term quartet
(cp, cpk, cpu, cpl) requires a within-subgroup sigma, so it is
None from ProcessCapability::compute_overall, which has none. A
long-term number is never reported under a short-term name.
§Index interpretation
| Index | Value | Interpretation |
|---|---|---|
| Cp/Pp | >= 1.33 | Process is capable |
| Cpk/Ppk | >= 1.33 | Process is capable and centered |
| Cpm | >= 1.33 | Process meets Taguchi loss criterion |
Reference: Montgomery (2020), Chapter 8, Table 8.5.
Fields§
§cp: Option<f64>Cp = (USL - LSL) / (6 * sigma_within). Requires both limits.
cpk: Option<f64>Cpk = min(Cpu, Cpl). Requires at least one limit.
cpu: Option<f64>Cpu = (USL - mean) / (3 * sigma_within). Requires USL.
cpl: Option<f64>Cpl = (mean - LSL) / (3 * sigma_within). Requires LSL.
pp: Option<f64>Pp = (USL - LSL) / (6 * sigma_overall). Requires both limits.
ppk: Option<f64>Ppk = min(Ppu, Ppl). Requires at least one limit.
ppu: Option<f64>Ppu = (USL - mean) / (3 * sigma_overall). Requires USL.
ppl: Option<f64>Ppl = (mean - LSL) / (3 * sigma_overall). Requires LSL.
cpm: Option<f64>Cpm = min(T - LSL, USL - T) / (3 * sigma_t), where sigma_t = sqrt(sum((x_i - T)^2) / (n - 1)) is the spread of every observation about the target T. With T at the specification midpoint the numerator is (USL - LSL) / 6, the form Chan, Cheng & Spiring (1988) give.
None unless both limits and a target are set, the target lies within
the limits, and sigma_t is positive. Cpm measures how closely the
process clusters about the target, so it depends on neither sigma
estimate above and is the same from ProcessCapability::compute and
ProcessCapability::compute_overall.
References: Chan, Cheng & Spiring (1988); Minitab, Capability Analysis (Normal) Formulas, for the numerator when T is not the midpoint.
mean: f64Sample mean of the data.
std_dev_within: Option<f64>Short-term (within-group) standard deviation – the value the caller
supplied to ProcessCapability::compute. None from
ProcessCapability::compute_overall, along with the four indices
that would be computed from it.
std_dev_overall: f64Long-term (overall) standard deviation.
n: usizeNumber of observations the indices were computed from.
Implementations§
Source§impl CapabilityIndices
impl CapabilityIndices
Sourcepub fn intervals(
&self,
confidence: f64,
within_df: Option<f64>,
) -> Result<CapabilityIntervals, IntervalError>
pub fn intervals( &self, confidence: f64, within_df: Option<f64>, ) -> Result<CapabilityIntervals, IntervalError>
Two-sided confidence intervals for Cp, Cpk, Pp and Ppk at confidence.
For a ratio of the specification width to k sigma estimated with df
degrees of freedom (Cp, Pp):
C * sqrt(chi2(a/2; df) / df) <= C <= C * sqrt(chi2(1 - a/2; df) / df)For the nearer-limit index (Cpk, Ppk), Bissell’s (1990) approximation:
Ck -/+ z(1 - a/2) * sqrt(1 / (9 n) + Ck^2 / (2 df))with a = 1 - confidence, n the number of observations (the mean’s
share) and df the degrees of freedom of the sigma (its share). The
overall sigma is the sample standard deviation, so Pp/Ppk use
n - 1. The within sigma’s degrees of freedom depend on how it was
estimated – n - m for a pooled standard deviation of m subgroups,
fewer for R-bar/d2 or a moving range (about 0.62 (n - 1) for MR-bar/d2,
Wheeler 2004) – so Cp/Cpk intervals are given only when within_df is.
§Errors
IntervalError when confidence is not in (0, 1), within_df is
not positive and finite, or within_df is given for indices computed
without a within sigma.
§Examples
use u_analytics::capability::ProcessCapability;
let spec = ProcessCapability::new(Some(11.0), Some(9.0)).unwrap();
let data = [9.5, 10.0, 10.2, 9.8, 10.1, 10.3, 9.9, 10.0, 10.4, 9.7];
let indices = spec.compute_overall(&data).unwrap();
// A one-sided 95 % lower bound is the lower limit of the 90 % interval.
let ci = indices.intervals(0.90, None).unwrap();
let ppk = ci.ppk.unwrap();
assert!(ppk.lower < indices.ppk.unwrap() && indices.ppk.unwrap() < ppk.upper);
assert!(ci.cpk.is_none()); // no within sigma