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 basis;
28pub mod clustering;
29pub mod depth;
30pub mod detrend;
31pub mod fdata;
32pub mod helpers;
33pub mod irreg_fdata;
34pub mod metric;
35pub mod outliers;
36pub mod regression;
37pub mod seasonal;
38pub mod simulation;
39pub mod smoothing;
40pub mod utility;
41
42// Re-export commonly used items
43pub use helpers::{
44    extract_curves, l2_distance, simpsons_weights, simpsons_weights_2d, DEFAULT_CONVERGENCE_TOL,
45    NUMERICAL_EPS,
46};
47
48// Re-export seasonal analysis types
49pub use seasonal::{
50    hilbert_transform, ChangeDetectionResult, ChangePoint, ChangeType, DetectedPeriod,
51    InstantaneousPeriod, Peak, PeakDetectionResult, PeriodEstimate, StrengthMethod,
52};
53
54// Re-export detrending types
55pub use detrend::{DecomposeResult, TrendResult};
56
57// Re-export simulation types
58pub use simulation::{EFunType, EValType};
59
60// Re-export irregular fdata types
61pub use irreg_fdata::IrregFdata;