NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #1523 most downloaded on crates.io
Statistical computing library for Rust
Last release 1 months ago
11 Aug 2026
Ships fairly regularly
a new release about every 9 months
Nearly every release is documented
notes for 24 of 25 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
25 releases · first in 2016
Fix nightly f64 deprecation warnings
gate density estimation behind a "kde" feature
One column per quarter.
approx directlystd featurecov_chol_decomp to clone_cov_chol_decomp and return a cloned matrixstd featuremu and cov methods to use correct types from nalgebra0.9 -> 0.10rand to 0.9.0 and mechanically modified the code to accommodate the changes in that dependency.catch_unwind from test codecore imports over stdf_onewaymannwhitneyumut in function header instead of in functionci: update lockfile to use statrs@0.18.0
ci: update lockfile to use statrs@0.18.0
rand and nalgebra.std_dev method to the Distribution trait explicitly.StatsError with module-level error types in distribution and its children.checked_logit, checked_multinomial, and similar methods to return Option to handle invalid inputs.Chi distribution to use u64 for degrees of freedom.nalgebra to version 0.33.
Cargo.toml and documentation.llvm-cov.crates.io.rustdoc warnings.StatsError with module-level error types.error module and preformatted NIST data.rustfmt.toml as part of CI clean-up.A few fixes, some dependency updates, most notably nalgebra . Breaking changes in statrs::StatsError, expect more changes later.
Revival!
A few fixes, some dependency updates, most notably nalgebra.
Breaking changes in statrs::StatsError, expect more changes later.
<!-- generated by git-cliff -->
chore: Release statrs version 0.17.0
chore: Release statrs version 0.17.0
inverse_cdf() for Uniform (#166)StatsError for finiteness (#218)MultivariateNormal API
MultivariateNormal::new_from_nalgebra (#177)std::vec vector input in addition to nalgebra vectors (#199)None instead of some negative number (#212)<D as DiscreteCDF>::inverse_cdf (#220)
nightly (#234)StatsError is Sync & Send (#226)lazy-static dependency and make FCACHE a proper const (#211)inverse_cdf as "quantile function" in docs (#213)text instead of ignore (#213)fixed integer bisection, see issue #185
fixed integer bisection, see issue #185
Adds an sf method to the ContinuousCDF and DiscreteCDF traits
sf method to the ContinuousCDF and DiscreteCDF traits
ContinuousCDF and DiscreteCDF
nalgebra to 0.29Bumping nalgebra due to RUSTSEC-2021-0070 advisory.
Bumping nalgebra due to RUSTSEC-2021-0070 advisory.
Merge pull request #139 from vks/fix-doctests
Merge pull request #139 from vks/fix-doctests
Fix doctests
rand dependency to 0.8GammaImplemented MultivariateNormal distribution (depends on nalgebra 0.19)
MultivariateNormal distribution (depends on nalgebra 0.19)Dirac distributionNegative Binomial distribution- upgrade rand dependency to 0.7
rand dependency to 0.7Implement CheckedInverseCDF and InverseCDF for Normal distribution
rand dependency to 0.6CheckedInverseCDF and InverseCDF for Normal distributionRemoved functions deprecated in 0.8.0 (periodic, periodic_custom, sinusoidal, sinusoidal_custom)
rand dependency to 0.5Distribution trait in favor of the rand::distributions::Distribution trait0.8.0 (periodic, periodic_custom, sinusoidal, sinusoidal_custom)deprecate old non-infinite iterators in favor of new infinite iterators with take
takePareto distributionEntropy trait for the Categorical distributionchecked_ interface to all distribution methods and functions that may panicSince the regression affects a very slim edge-case and the fix is very simple, no breaking changes to the Statistics API was deemed necessary
cdf(x), pdf(x) and pmf(x) now return the correct value instead of panicking when x is outside the range of values that the distribution can attain.Uniform distribution implementation where samples were drawn from range [min, max + 1) instead of [min, max]. The samples are now drawn correctly from the range [min, max].generate::log_spaced functiongenerate::Periodic iteratorgenerate::Sinusoidal iteratorgenerate::Square iteratorgenerate::Triangle iteratorgenerate::Sawtooth iteratorgenerate::periodic and generate::periodic_customgenerate::sinusoidal and generate::sinusoidal_customNote: A recent commit to the Rust nightly build causes compile errors when using
empty slices with the Statistics trait, specifically the Statistics::min and
Statistics::max methods. This only affects the case where the compiler must infer
the type of the empty slice:
use statrs::statistics::Statistics;
// compile error! Assumes the use of Ord::min rather than
// Statistcs::min
let x = [];
assert!(x.min().is_nan());
The fix is to pin the type of the empty slice:
// no compile error
let x: [f64; 0] = [];
assert!(x.min().is_nan());
Since the regression affects a very slim edge-case and the fix is very simple, no breaking changes to the Statistics API was deemed necessary
Implemented Categorical distribution
Categorical distributionErlang distributionMultinomial distributionInverseCDF trait for distributions that implement the inverse cdf functiongamma::gamma_ur, gamma::gamma_ui, gamma::gamma_lr, and gamma::gamma_li now follow strict gamma function domain, panicking if a or x are not in (0, +in
gamma::gamma_ur, gamma::gamma_ui, gamma::gamma_lr, and gamma::gamma_li now follow strict gamma function domain, panicking if a or x are not in (0, +inf)beta::beta_reg no longer allows 0.0 for a or b argumentsInverseGamma distribution no longer accepts f64::INFINITY as valid arguments for shape or rate as the value is nonsenseBinomial::cdf no longer accepts arguments outside the domain of [0, n]Bernoulli::cdf no longer accepts arguments outside the domain of [0, 1]DiscreteUniform::cdf no longer accepts arguments outside the domain of [min, max]Uniform::cdf no longer accepts arguments outside the domain of [min, max]Triangular::cdf no longer accepts arguments outside the domain of [min, max]FisherSnedecor no longer accepts f64::INFINITY as a valid argument for freedom_1 or freedom_2FisherSnedecor::cdf no longer accepts arguments outside the domain of [0, +inf)Geometric::cdf no longer accepts non-positive argumentsNormal now uses the Ziggurat method to generate random samples. This also affects all distributions depending on Normal for sampling
including Chi, LogNormal, Gamma, and StudentsTExponential now uses the Ziggurat methd to generate random samples.Binomial now implements Univariate<u64, f64> rather than Univariate<i64, f64>, meaning Binomial::min and Binomial::max now return u64Bernoulli now implements Univariate<u64, f64> rather than Univariate<i64, f64>, meaning Bernoulli::min and Bernoulli::min now return u64Geometric now implements Univariate<u64, f64> rather than Univariate<i64, f64>, meaning Geometric::min and Geometric::min now return u64Poisson now implements Univariate<u64, f64> rather than Univariate<i64, f64>, meaning Poisson::min and Poisson::min now return u64Binomial now implements Mode<u64> instead of Mode<i64>Bernoulli now implements Mode<u64> instead of Mode<i64>Poisson now implements Mode<u64> instead of Mode<i64>Geometric now implements Mode<u64> instead of Mode<i64>Hypergeometric now implements Mode<u64> instead of Mode<i64>Binomial now implements Discrete<u64, f64> rather than Discrete<i64, f64>Bernoulli now implements Discrete<u64, f64> rather than Discrete<i64, f64>Geometric now implements Discrete<u64, f64> rather than Discrete<i64, f64>Hypergeometric now implements Discrete<u64, f64> rather than Discrete<i64, f64>Poisson now implements Discrete<u64, f64> rather than Discrete<i64, f64>Fixed critical bug in normal::sample_unchecked where it was returning NaN
normal::sample_unchecked where it was returning NaNImplemented the logistic::logistic special function
logistic::logistic special functionlogistic::logit special functionfactorial::multinomial special functionharmonic::harmonic special functionharmonic::gen_harmonic special functionInverseGamma distributionGeometric distributionHypergeometric distributiongamma::gamma_ur now panics when x > 0 or a == f64::NEG_INFINITY. In addition, it also returns f64::NAN when a == f64::INFINITY and 0.0 when x == f64::INFINITYGamma::pdf and Gamma::ln_pdf now return f64::NAN if any of shape, rate, or x are f64::INFINITYBinomial::pdf and Binomial::ln_pdf now panic if x > n or x < 0Bernoulli::pdf and Bernoulli::ln_pdf now panic if x > 1 or x < 0Implemented the exponential::integral special function
exponential::integral special functionCauchy (otherwise known as the Lorenz) distributionDirichlet distributionContinuous and Discrete traits no longer dependent on Distribution traitImplemented the FisherSnedecor (F) distribution
FisherSnedecor (F) distributionRemoved print statements from ln_pdf method in Beta distribution
ln_pdf method in Beta distributionMoved methods min and max out of trait Univariate into their own respective traits Min and Max
min and max out of trait Univariate into their own respective traits Min and MaxMin, Max, Mean, Variance, Entropy, Skewness, Median, and Mode moved from distribution module to statistics moduleMean, Variance, Entropy, Skewness, Median, and Mode no longer depend on Distribution traitMean, Variance, Skewness, and Mode are now generic over only one type, the return type, due to not depending on Distribution anymoreorder_statistic, median, quantile, percentile, lower_quartile, upper_quartile, interquartile_range, and ranks methods removed
from Statistics trait.min, max, mean, variance, and std_dev methods added to Statistics traitStatistics trait now implemented for all types implementing IntoIterator where Item implements Borrow<f64>. Slice now implicitly implements
Statistics through this new implementation.Min, Max, Mean, and Variance but now through the Statistics implementation rather than its own implementationInplaceStatistics renamed to OrderStatistics, all methods in InplaceStatistics have _inplace trimmed from method name.gamma::inv_digamma(x: f64) -> f64Created statistics module and Statistics trait
statistics module and Statistics traitStatistics trait implementation for [f64]Beta distributionModulus trait and implementations for f32, f64, i32, i64, u32, and u64 in euclid modulegenerate moduleNothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →