Skip to main content

u_analytics/
lib.rs

1//! # u-analytics
2//!
3//! Statistical process control (SPC), process capability analysis, Weibull
4//! reliability, and change-point detection.
5//!
6//! This crate provides industrial quality analysis tools that are
7//! domain-agnostic — they operate on raw `f64` data without knowledge
8//! of manufacturing, scheduling, or any specific consumer domain.
9//!
10//! ## Modules
11//!
12//! - [`spc`] — Control charts (X̄-R, X̄-S, I-MR, P, NP, C, U) with run rules
13//! - [`capability`] — Process capability indices (Cp, Cpk, Pp, Ppk, Cpm)
14//! - [`weibull`] — Weibull parameter estimation (MLE, MRR) and reliability analysis
15//! - [`detection`] — Change-point detection (CUSUM, EWMA, PELT)
16//! - [`smoothing`] — Time series smoothing (SES, Holt, Holt-Winters)
17//! - [`seasonality`] — Periodogram and dominant-period estimation (AutoPeriod)
18//! - [`correlation`] — Correlation analysis (Pearson, Spearman, Kendall, matrices)
19//! - [`regression`] — Regression analysis (simple, multiple OLS, VIF)
20//! - [`distribution`] — Distribution analysis (ECDF, histogram bins, QQ-plot, KS test)
21//! - [`testing`] — Hypothesis testing (t-tests, ANOVA, chi-squared, normality)
22//! - [`msa`] — Measurement System Analysis (Gage R&R, ANOVA method)
23//!
24//! ## Design Philosophy
25//!
26//! - **Domain-agnostic**: No manufacturing or process-specific types
27//! - **Numerical stability**: Leverages `u-numflow` for stable statistics
28//! - **Research-backed**: All algorithms reference academic literature
29
30/// This crate's version, as published (`CARGO_PKG_VERSION`) — for a consumer
31/// that reports what it was built against without reading a lock file.
32///
33/// ```
34/// assert!(!u_analytics::VERSION.is_empty());
35/// ```
36pub const VERSION: &str = env!("CARGO_PKG_VERSION");
37
38pub mod capability;
39pub mod correlation;
40pub mod counter;
41pub mod detection;
42pub mod distribution;
43pub mod msa;
44pub mod point_process;
45pub mod regression;
46pub mod seasonality;
47pub mod smoothing;
48pub mod spc;
49pub mod testing;
50pub mod weibull;
51
52/// The JSON wire contract shared by the `ffi` and `wasm` transports.
53#[cfg(any(feature = "ffi", feature = "wasm"))]
54mod wire;
55
56#[cfg(feature = "wasm")]
57pub mod wasm;
58
59#[cfg(all(test, feature = "wasm"))]
60mod engine_card;
61
62#[cfg(feature = "ffi")]
63pub mod ffi;
64
65// The README's Rust examples are the first code most users copy, so they are
66// compiled and run with the doc-tests. Without this they were checked by
67// nothing, and one stopped compiling when a constructor began returning
68// `Result` without any test noticing.
69#[cfg(doctest)]
70#[doc = include_str!("../README.md")]
71pub struct ReadmeDoctests;