pub struct IndividualMRChart { /* private fields */ }Expand description
Individual and Moving Range (I-MR) control chart.
Monitors individual observations (subgroup size = 1) using the moving range of consecutive observations to estimate process variability.
§Algorithm
- Compute moving ranges: MR_i = |x_i - x_{i-1}| for i >= 1.
- Compute the mean of individual observations (X-bar) and the average moving range (MR-bar).
- I chart limits: CL = X-bar, UCL/LCL = X-bar +/- E2 * MR-bar.
- MR chart limits: CL = MR-bar, UCL = D4 * MR-bar, LCL = 0.
§Examples
use u_analytics::spc::{IndividualMRChart, ControlChart};
let mut chart = IndividualMRChart::new();
for &x in &[25.0, 25.2, 24.8, 25.1, 24.9, 25.3, 25.0, 24.7] {
chart.add_sample(&[x]);
}
let limits = chart.control_limits().expect("should have limits after 2+ observations");
assert!(limits.ucl > limits.cl);
assert!(limits.cl > limits.lcl);§Reference
Montgomery, D.C. (2019). Introduction to Statistical Quality Control, 8th ed., Chapter 6: Control Charts for Variables.
Implementations§
Source§impl IndividualMRChart
impl IndividualMRChart
Sourcepub fn mr_limits(&self) -> Option<ControlLimits>
pub fn mr_limits(&self) -> Option<ControlLimits>
Get the MR chart control limits, or None if insufficient data.
Sourcepub fn mr_points(&self) -> &[ChartPoint]
pub fn mr_points(&self) -> &[ChartPoint]
Get the MR chart points.
Trait Implementations§
Source§impl ControlChart for IndividualMRChart
impl ControlChart for IndividualMRChart
Source§fn add_sample(&mut self, sample: &[f64])
fn add_sample(&mut self, sample: &[f64])
Add a single observation. The sample slice must contain exactly one element.
Source§fn control_limits(&self) -> Option<ControlLimits>
fn control_limits(&self) -> Option<ControlLimits>
Get the computed control limits, or
None if insufficient data.Source§fn is_in_control(&self) -> bool
fn is_in_control(&self) -> bool
Check if the process is in statistical control. Read more
Source§fn violations(&self) -> Vec<Violation>
fn violations(&self) -> Vec<Violation>
Get all violations detected across all chart points.
Source§fn points(&self) -> &[ChartPoint]
fn points(&self) -> &[ChartPoint]
Get all chart points.
Auto Trait Implementations§
impl Freeze for IndividualMRChart
impl RefUnwindSafe for IndividualMRChart
impl Send for IndividualMRChart
impl Sync for IndividualMRChart
impl Unpin for IndividualMRChart
impl UnwindSafe for IndividualMRChart
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more