#ndarray #statistics #random #probability

truncnorm

Normal and Truncated Normal distributions

14 releases (4 breaking)

0.5.1 Mar 22, 2022
0.5.0 Feb 23, 2022
0.4.3 Dec 11, 2021
0.4.2 Nov 18, 2021
0.1.0 Jul 25, 2021

#409 in Simulation


Used in nnv-rs

MIT license

170KB
3K SLoC

C 2K SLoC // 0.2% comments Rust 1K SLoC // 0.1% comments

truncnorm

Statistics package with Normal and Truncated Normal distributions for Rust with ndarray.

Installation

cargo install truncnorm

Examples

Examples to come as soon as there's any interest expressed. Feel free to open an issue on GitHub.

Docs

To render the maths:

RUSTDOCFLAGS="--html-in-header katex-header.html" cargo doc --no-deps

lib.rs:

truncnorm provides fast, high-dimensional multivariate Normal and TruncatedNormal distributions as well as low level binding to Gaussian error functions.

I've written all this code for my dissertation work. I've put some effort into correctness and speed, but both could surely be improved. Rely on this code at your own risk as no guarantees can be made about it. Feel free to contact me if you're interested in using this for any purpose and it doesn't work 100%.

Largely based on the Matlab Truncated Normal and Student's t-distribution toolbox and Faddeeva C library

Cheers!
Eleanor Quint

Dependencies

~75MB
~1M SLoC