fdars_core/
lib.rs

1//! # fdars-core
2//!
3//! Core algorithms for Functional Data Analysis in Rust.
4//!
5//! This crate provides pure Rust implementations of various FDA methods including:
6//! - Functional data operations (mean, derivatives, norms)
7//! - Depth measures (Fraiman-Muniz, modal, band, random projection, etc.)
8//! - Distance metrics (Lp, Hausdorff, DTW, Fourier, etc.)
9//! - Basis representations (B-splines, P-splines, Fourier)
10//! - Clustering (k-means, fuzzy c-means)
11//! - Smoothing (Nadaraya-Watson, local linear/polynomial regression)
12//! - Outlier detection
13//! - Regression (PCA, PLS, ridge)
14//! - Seasonal analysis (period estimation, peak detection, seasonal strength)
15//! - Detrending and decomposition for non-stationary data
16//!
17//! ## Data Layout
18//!
19//! Functional data is represented as column-major matrices stored in flat vectors:
20//! - For n observations with m evaluation points: `data[i + j * n]` gives observation i at point j
21//! - 2D surfaces (n observations, m1 x m2 grid): stored as n x (m1*m2) matrices
22
23#![allow(clippy::needless_range_loop)]
24#![allow(clippy::too_many_arguments)]
25#![allow(clippy::type_complexity)]
26
27pub mod parallel;
28
29pub mod basis;
30pub mod clustering;
31pub mod depth;
32pub mod detrend;
33pub mod fdata;
34pub mod helpers;
35pub mod irreg_fdata;
36pub mod metric;
37pub mod outliers;
38pub mod regression;
39pub mod seasonal;
40pub mod simulation;
41pub mod smoothing;
42pub mod utility;
43
44// Re-export commonly used items
45pub use helpers::{
46    extract_curves, l2_distance, simpsons_weights, simpsons_weights_2d, DEFAULT_CONVERGENCE_TOL,
47    NUMERICAL_EPS,
48};
49
50// Re-export seasonal analysis types
51pub use seasonal::{
52    autoperiod, autoperiod_fdata, cfd_autoperiod, cfd_autoperiod_fdata, hilbert_transform, sazed,
53    sazed_fdata, AutoperiodCandidate, AutoperiodResult, CfdAutoperiodResult, ChangeDetectionResult,
54    ChangePoint, ChangeType, DetectedPeriod, InstantaneousPeriod, Peak, PeakDetectionResult,
55    PeriodEstimate, SazedComponents, SazedResult, StrengthMethod,
56};
57
58// Re-export detrending types
59pub use detrend::{DecomposeResult, TrendResult};
60
61// Re-export simulation types
62pub use simulation::{EFunType, EValType};
63
64// Re-export irregular fdata types
65pub use irreg_fdata::IrregFdata;