#probability-density #non-parametric


Kernel Density Estimation in Rust

1 unstable release

0.1.0 Oct 16, 2022

#138 in #statistics

Download history 4/week @ 2023-06-01 5/week @ 2023-06-08 4/week @ 2023-06-15 1/week @ 2023-06-22 1/week @ 2023-06-29 4/week @ 2023-07-06 2/week @ 2023-07-13 1/week @ 2023-07-20 4/week @ 2023-07-27 2/week @ 2023-08-03 3/week @ 2023-08-10 21/week @ 2023-08-17 11/week @ 2023-08-24 29/week @ 2023-08-31 18/week @ 2023-09-07 4/week @ 2023-09-14

63 downloads per month

MIT license

330 lines


Kernel Density Estimation in Rust

Note: Currently only univariate distributions are supported but multivariate is a goal in the future!


univariate - This example showcases the core pdf, cdf, and sample functionalities for a univariate distribution.

cargo run --example univariate

Univariate Distribution

kernel - This example showcases each of the available kernel functions.

cargo run --example kernel

Kernel Functions


Refer to the milestone issues to see the direction the project is headed in future releases or CHANGELOG.md to see the changes between each release.


Distributed under the MIT License. See LICENSE for more information.


Kernel density estimation in Rust.

Kernel density estimation (KDE) is a non-parametric method to estimate the probability density function of a random variable by taking the summation of kernel functions centered on each data point. This crate serves three major purposes based on this idea:

  1. Evaluate the probability density function of a random variable.
  2. Evaluate the cumulative distribution function of a random variable.
  3. Sample data points from the probability density function.

An excellent technical description of the method is available here[^citation].

[^citation]: García-Portugués, E. (2022). Notes for Nonparametric Statistics. Version 6.5.9. ISBN 978-84-09-29537-1. use kernel_density_estimation::prelude::*; to import all common functionality.