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