solow_nonparametric/lib.rs
1//! # solow-nonparametric
2//!
3//! Nonparametric smoothers for the Solow statistical-computing stack.
4//!
5//! This crate provides three families of nonparametric tools, each verified
6//! against the canonical Python reference implementation to tight tolerances:
7//!
8//! * [`lowess`] — LOWESS (locally-weighted scatterplot smoothing), a robust
9//! locally-weighted linear regression following Cleveland (1979).
10//! * Rule-of-thumb bandwidth selectors: [`bw_silverman`], [`bw_scott`] and
11//! [`bw_normal_reference`].
12//! * [`KdeUnivariate`] — a univariate Gaussian kernel density estimator.
13//!
14//! All routines operate on [`ndarray`] `Array1<f64>` data.
15//!
16//! ## Example
17//!
18//! ```
19//! use ndarray::array;
20//! use solow_nonparametric::lowess;
21//!
22//! let x = array![1.0, 2.0, 3.0, 4.0, 5.0];
23//! let y = array![1.0, 1.9, 3.2, 3.8, 5.1];
24//! let fit = lowess(&y, &x, Default::default()).unwrap();
25//! assert_eq!(fit.x.len(), 5);
26//! assert_eq!(fit.fitted.len(), 5);
27//! ```
28
29mod bandwidths;
30mod kde;
31mod kernel_reg;
32mod smoothers;
33
34pub use bandwidths::{bw_normal_reference, bw_scott, bw_silverman, select_sigma};
35pub use kde::{Bandwidth, KdeFit, KdeUnivariate};
36pub use kernel_reg::{KdeMultivariate, KernelReg, RegType};
37pub use smoothers::{lowess, LowessFit, LowessOptions};