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
//! LOESS (Locally Estimated Scatterplot Smoothing)
//!
//! Non-parametric regression method that fits multiple regressions in local
//! subsets of data to create a smooth curve through the data points.
//!
//! # References
//!
//! - Cleveland, W. S. (1979). "Robust Locally Weighted Regression and Smoothing Scatterplots".
//! *Journal of the American Statistical Association*. 74 (368): 829-836.
//!
//! # Overview
//!
//! LOESS works by:
//! 1. For each point to be fitted, finding the k nearest neighbors (where k = span * n)
//! 2. Assigning weights to neighbors using the tricube kernel function
//! 3. Fitting a weighted least squares polynomial (constant, linear, or quadratic)
//! 4. Using the fitted value as the smoothed value at that point
//!
//! Optionally, robust fitting iterations can be performed to reduce the influence
//! of outliers using a biweight function.
//!
//! # Example
//!
//! ```rust,no_run
//! use linreg_core::loess::{loess_fit, LoessOptions};
//!
//! let x = vec![0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0];
//! let y = vec![1.0, 3.5, 4.8, 6.2, 8.5, 11.0, 13.2, 14.8, 17.5, 19.0, 22.0];
//!
//! let options = LoessOptions::default();
//! let result = loess_fit(&y, &[x], &options).unwrap();
//! ```
// Public API re-exports
pub use loess_fit;
pub use ;
pub use ;
pub use tricube_weight;
pub use WlsDecomposition;