Expand description
§solow-nonparametric
Nonparametric smoothers for the Solow statistical-computing stack.
This crate provides three families of nonparametric tools, each verified against the canonical Python reference implementation to tight tolerances:
lowess— LOWESS (locally-weighted scatterplot smoothing), a robust locally-weighted linear regression following Cleveland (1979).- Rule-of-thumb bandwidth selectors:
bw_silverman,bw_scottandbw_normal_reference. KdeUnivariate— a univariate Gaussian kernel density estimator.
All routines operate on ndarray Array1<f64> data.
§Example
use ndarray::array;
use solow_nonparametric::lowess;
let x = array![1.0, 2.0, 3.0, 4.0, 5.0];
let y = array![1.0, 1.9, 3.2, 3.8, 5.1];
let fit = lowess(&y, &x, Default::default()).unwrap();
assert_eq!(fit.x.len(), 5);
assert_eq!(fit.fitted.len(), 5);Structs§
- KdeFit
- Output of
KdeUnivariate::fit: the evaluation grid (support), the estimateddensityat each grid point, and the bandwidthbwused. - KdeMultivariate
- Product-Gaussian multivariate kernel density estimator with a fixed
bandwidth, mirroring the reference’s
KDEMultivariatefor all-continuous variables. - KdeUnivariate
- Univariate kernel density estimator.
- Kernel
Reg - Multivariate Nadaraya–Watson kernel regression with a product Gaussian kernel and a fixed bandwidth.
- Lowess
Fit - Result of a
lowessfit: the input abscissae sorted ascending, together with the smoothed ordinate at each sorted abscissa. - Lowess
Options - Options controlling
lowess.
Enums§
- Bandwidth
- Bandwidth selection rule for
KdeUnivariate::fit. - RegType
- Local polynomial order for
KernelReg.
Functions§
- bw_
normal_ reference - Normal-reference plug-in bandwidth for the Gaussian kernel:
C · A · n^(-1/5)withC ≈ 1.0592238410488122. - bw_
scott - Scott’s rule-of-thumb bandwidth:
1.059 · A · n^(-1/5). - bw_
silverman - Silverman’s rule-of-thumb bandwidth:
0.9 · A · n^(-1/5). - lowess
- Compute the LOWESS smooth of
endogagainstexog. - select_
sigma - Robust scale estimate
A = min(std(x, ddof=1), IQR / 1.349).