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
//! Layer 2: Math
//!
//! # Purpose
//!
//! This layer provides pure mathematical functions used throughout LOESS:
//! - Kernel functions for distance-based weighting
//! - Robust statistics (MAD)
//! - Linear algebra backends
//! - Hat matrix computation
//!
//! These are reusable mathematical building blocks with no algorithm-specific logic.
//!
//! # Architecture
//!
//! ```text
//! Layer 7: API
//! ↓
//! Layer 6: Adapters
//! ↓
//! Layer 5: Engine
//! ↓
//! Layer 4: Evaluation
//! ↓
//! Layer 3: Algorithms
//! ↓
//! Layer 2: Math ← You are here
//! ↓
//! Layer 1: Primitives
//! ```
/// Kernel (weight) functions for distance-based weighting.
/// Robust scale estimation (MAR/MAD).
/// Boundary padding utilities.
/// Distance metrics for nD LOESS.
/// nD neighborhood search (KD-Tree implementation).
/// Linear algebra backend abstraction.
/// Hat matrix and delta parameter computation.