Skip to main content

Crate solow_nonparametric

Crate solow_nonparametric 

Source
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:

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 estimated density at each grid point, and the bandwidth bw used.
KdeMultivariate
Product-Gaussian multivariate kernel density estimator with a fixed bandwidth, mirroring the reference’s KDEMultivariate for all-continuous variables.
KdeUnivariate
Univariate kernel density estimator.
KernelReg
Multivariate Nadaraya–Watson kernel regression with a product Gaussian kernel and a fixed bandwidth.
LowessFit
Result of a lowess fit: the input abscissae sorted ascending, together with the smoothed ordinate at each sorted abscissa.
LowessOptions
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) with C ≈ 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 endog against exog.
select_sigma
Robust scale estimate A = min(std(x, ddof=1), IQR / 1.349).