pub fn gaussian_function(x: &Z, c: &Q, s: &Q) -> f64Expand description
Computes the value of the Gaussian function for x.
Warning: This functions assumes s != 0.
Parameters:
x: specifies the value/ sample for which the Gaussian function’s value is computedc: specifies the position of the center with peak probabilitys: specifies the Gaussian parameter, which is proportional to the standard deviationsigma * sqrt(2 * pi) = s
Returns the computed value of the Gaussian function for x.
§Examples
use qfall_math::{integer::Z, rational::Q};
use qfall_math::utils::sample::discrete_gauss::gaussian_function;
let sample = Z::ONE;
let center = Q::ZERO;
let gaussian_parameter = Q::ONE;
let probability = gaussian_function(&sample, ¢er, &gaussian_parameter);§Panics …
- if
s = 0. - if
-π * (x - c)^2 / s^2is larger thanf64::MAX