Trait statrs::statistics::VarianceN[][src]

pub trait VarianceN<T> {
    fn variance(&self) -> Option<T>;
}

Required methods

fn variance(&self) -> Option<T>[src]

Implementors

impl VarianceN<Matrix<f64, Dynamic, Dynamic, VecStorage<f64, Dynamic, Dynamic>>> for Dirichlet[src]

fn variance(&self) -> Option<DMatrix<f64>>[src]

Returns the variances of the dirichlet distribution

Formula

(α_i * (α_0 - α_i)) / (α_0^2 * (α_0 + 1))

for the ith element where α_i is the ith concentration parameter and α_0 is the sum of all concentration parameters

impl VarianceN<Matrix<f64, Dynamic, Dynamic, VecStorage<f64, Dynamic, Dynamic>>> for Multinomial[src]

fn variance(&self) -> Option<DMatrix<f64>>[src]

Returns the variance of the multinomial distribution

Formula

n * p_i * (1 - p_i) for i in 1...k

where n is the number of trials, p_i is the ith probability, and k is the total number of probabilities

impl VarianceN<Matrix<f64, Dynamic, Dynamic, VecStorage<f64, Dynamic, Dynamic>>> for MultivariateNormal[src]

fn variance(&self) -> Option<DMatrix<f64>>[src]

Returns the covariance matrix of the multivariate normal distribution