Module distributions

Source
Expand description

Probability distribution functions applied element-wise to matrices.

Includes approximations for the normal, uniform and gamma distributions as well as the error function.

use rustframe::compute::stats::distributions;
use rustframe::matrix::Matrix;

let x = Matrix::from_vec(vec![0.0], 1, 1);
let pdf = distributions::normal_pdf(x.clone(), 0.0, 1.0);
assert!((pdf.get(0,0) - 0.3989).abs() < 1e-3);

Functions§

binomial_cdf
CDF of the Binomial(n, p) for matrices
binomial_pmf
PMF of the Binomial(n, p) distribution for matrices
erf
Approximation of the error function for matrices
gamma
gamma_cdf
CDF of the Gamma distribution for matrices
gamma_pdf
PDF of the Gamma distribution for matrices
lower_incomplete_gamma
Lower incomplete gamma for matrices
normal_cdf
CDF of the Normal distribution for matrices
normal_pdf
PDF of the Normal distribution for matrices
poisson_cdf
CDF of the Poisson(λ) distribution for matrices
poisson_pmf
PMF of the Poisson(λ) distribution for matrices
uniform_cdf
CDF of the Uniform distribution on [a, b] for matrices
uniform_pdf
PDF of the Uniform distribution on [a, b] for matrices