pub trait GaussianFunctions<T> {
// Required methods
fn mean(&self) -> T;
fn var(&self) -> T;
fn std(&self) -> T;
fn pr(&self, x: T) -> T;
}Required Methods§
Sourcefn mean(&self) -> T
fn mean(&self) -> T
Returns the mean of the Gaussian distribution.
§Examples
use rustml::gaussian::*;
use rustml::Normalization;
let a = vec![1.0f32, 2.0, 4.0, 3.0, 6.0, 5.0];
let g = a.gaussian(Normalization::N);
assert_eq!(g.mean(), 3.5);Sourcefn var(&self) -> T
fn var(&self) -> T
Returns the variance of the Gaussian distribution.
§Examples
use rustml::gaussian::*;
use rustml::Normalization;
let a = vec![1.0f32, 2.0, 4.0, 3.0, 6.0, 5.0];
let g = a.gaussian(Normalization::N);
assert!(g.var() - 2.9167 <= 0.0001);Sourcefn std(&self) -> T
fn std(&self) -> T
Returns the standard deviation (the square root of the variance) of the Gaussian distribution.
§Examples
use rustml::gaussian::*;
use rustml::Normalization;
let a = vec![1.0f32, 2.0, 4.0, 3.0, 6.0, 5.0];
let g = a.gaussian(Normalization::N);
assert!(g.std() - 1.7078 <= 0.0001);