Skip to main content

UChart

Struct UChart 

Source
pub struct UChart { /* private fields */ }
Expand description

Defects per unit (U) chart.

Monitors the defect rate when the area of opportunity (inspection size) varies between subgroups. Control limits are computed individually for each subgroup based on its inspection size.

§Formulas

  • CL = u-bar = total_defects / total_units
  • UCL_i = u-bar + 3 * sqrt(u-bar / n_i)
  • LCL_i = max(0, u-bar - 3 * sqrt(u-bar / n_i))

A known u-bar from a Phase I study is given with UChart::with_center; see PChart for why it is not re-estimated from later samples.

§Reference

Montgomery, D.C. (2019). Introduction to Statistical Quality Control, 8th ed., Chapter 7, Section 7.4.

Implementations§

Source§

impl UChart

Source

pub fn new() -> Self

Create a new U chart that estimates u-bar from its samples (Phase I).

Source

pub fn with_center(u_bar: f64) -> Result<Self, ControlChartError>

Create a U chart whose centre line is a known u-bar (Phase II).

§Errors

ControlChartError::InvalidStandard unless u_bar is finite and positive.

Source

pub fn add_sample( &mut self, defects: u64, units_inspected: f64, ) -> Result<(), ControlChartError>

Add a sample with the number of defects and the number of units inspected.

The units_inspected can be fractional (e.g., area or length).

§Errors

ControlChartError::NonPositiveUnits if units_inspected is not a positive, finite number. The chart is left unchanged.

Source

pub fn u_bar(&self) -> Option<f64>

The centre line in use — the known u-bar for a chart built with_center, otherwise the estimate — or None if no data.

Source

pub fn points(&self) -> &[AttributeChartPoint]

Get all chart points.

Source

pub fn is_in_control(&self) -> bool

Check if the process is in statistical control.

Trait Implementations§

Source§

impl Default for UChart

Source§

fn default() -> Self

Returns the “default value” for a type. 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> 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, 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.