Skip to main content

CapabilityIndices

Struct CapabilityIndices 

Source
pub struct CapabilityIndices {
Show 13 fields pub cp: Option<f64>, pub cpk: Option<f64>, pub cpu: Option<f64>, pub cpl: Option<f64>, pub pp: Option<f64>, pub ppk: Option<f64>, pub ppu: Option<f64>, pub ppl: Option<f64>, pub cpm: Option<f64>, pub mean: f64, pub std_dev_within: Option<f64>, pub std_dev_overall: f64, pub n: usize,
}
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

IndexValueInterpretation
Cp/Pp>= 1.33Process is capable
Cpk/Ppk>= 1.33Process is capable and centered
Cpm>= 1.33Process 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: f64

Sample 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: f64

Long-term (overall) standard deviation.

§n: usize

Number of observations the indices were computed from.

Implementations§

Source§

impl CapabilityIndices

Source

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

Trait Implementations§

Source§

impl Clone for CapabilityIndices

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CapabilityIndices

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.