1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
//! Statistical distributions, hypothesis tests, and descriptive statistics.
//!
//! This module provides a comprehensive statistics library with full GPU acceleration
//! via numr's multi-runtime architecture.
//!
//! # Runtime-Generic API
//!
//! Statistics algorithms are organized into focused traits:
//! - [`DescriptiveStatisticsAlgorithms`] - Computing statistics (mean, variance, skewness, etc.)
//! - [`HypothesisTestingAlgorithms`] - Statistical hypothesis tests (t-tests, ANOVA, normality)
//! - [`RegressionAlgorithms`] - Regression analysis (linear regression)
//! - [`RobustStatisticsAlgorithms`] - Robust statistics (trimmed mean, MAD, Theil-Sen)
//! - [`InformationTheoryAlgorithms`] - Information theory (entropy, KL divergence, mutual info)
//!
//! All are generic over numr's `Runtime`, so the same code works on CPU, CUDA, and WebGPU.
//!
//! # Distributions
//!
//! Distributions have both scalar and batch (tensor) methods:
//!
//! ```
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! use solvr::stats::{Normal, ContinuousDistribution};
//! use numr::runtime::cpu::{CpuClient, CpuDevice};
//! use numr::tensor::Tensor;
//!
//! let n = Normal::standard();
//!
//! // Scalar - for single values
//! let p = n.pdf(0.0);
//!
//! // Batch - for tensor operations (GPU-accelerated)
//! let device = CpuDevice::new();
//! let client = CpuClient::new(device.clone());
//! let x = Tensor::from_slice(&[0.0, 1.0, 2.0], &[3], &device);
//! let p_batch = n.pdf_tensor(&x, &client)?;
//! # Ok(())
//! # }
//! ```
// Backend implementations
// Shared generic implementations
// Traits and types
// Core modules
// Public API: Trait exports
pub use ;
// Public API: Distribution traits and types
pub use ;
pub use ;
// Public API: Continuous distributions
pub use ;
// Public API: Discrete distributions
pub use ;