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//! - [`decomposition`] — Seasonal-trend decomposition by Loess (STL)
19//! - [`correlation`] — Correlation analysis (Pearson, Spearman, Kendall, matrices)
20//! - [`regression`] — Regression analysis (simple, multiple OLS, VIF)
21//! - [`distribution`] — Distribution analysis (ECDF, histogram bins, QQ-plot, KS test)
22//! - [`testing`] — Hypothesis testing (t-tests, ANOVA, chi-squared, normality)
23//! - [`error`] — Refusals shared by more than one module ([`error::TimeSeriesError`])
24//! - [`msa`] — Measurement System Analysis (Gage R&R, ANOVA method)
25//!
26//! ## Design Philosophy
27//!
28//! - **Domain-agnostic**: No manufacturing or process-specific types
29//! - **Numerical stability**: Leverages `u-numflow` for stable statistics
30//! - **Research-backed**: All algorithms reference academic literature
31
32/// This crate's version, as published (`CARGO_PKG_VERSION`) — for a consumer
33/// that reports what it was built against without reading a lock file.
34///
35/// ```
36/// assert!(!u_analytics::VERSION.is_empty());
37/// ```
38pub const VERSION: &str = env!("CARGO_PKG_VERSION");
39
40pub mod capability;
41pub mod correlation;
42pub mod counter;
43pub mod decomposition;
44pub mod detection;
45pub mod distribution;
46pub mod error;
47pub mod msa;
48pub mod point_process;
49pub mod regression;
50pub mod seasonality;
51pub mod smoothing;
52pub mod spc;
53pub mod testing;
54pub mod weibull;
55
56/// The JSON wire contract shared by the `ffi` and `wasm` transports.
57#[cfg(any(feature = "ffi", feature = "wasm"))]
58mod wire;
59
60#[cfg(feature = "wasm")]
61pub mod wasm;
62
63#[cfg(all(test, feature = "wasm"))]
64mod engine_card;
65
66#[cfg(feature = "ffi")]
67pub mod ffi;
68
69// The README's Rust examples are the first code most users copy, so they are
70// compiled and run with the doc-tests. Without this they were checked by
71// nothing, and one stopped compiling when a constructor began returning
72// `Result` without any test noticing.
73#[cfg(doctest)]
74#[doc = include_str!("../README.md")]
75pub struct ReadmeDoctests;