MultivariateDistribution

Trait MultivariateDistribution 

Source
pub trait MultivariateDistribution<F: Float> {
    // Required methods
    fn pdf(&self, x: &Array1<F>) -> F;
    fn rvs(&self, size: usize) -> StatsResult<Array2<F>>;
    fn mean(&self) -> Array1<F>;
    fn cov(&self) -> Array2<F>;
    fn dim(&self) -> usize;

    // Provided methods
    fn logpdf(&self, x: &Array1<F>) -> F { ... }
    fn rvs_single(&self) -> StatsResult<Vec<F>> { ... }
}
Expand description

Trait for multivariate distributions

Required Methods§

Source

fn pdf(&self, x: &Array1<F>) -> F

Probability density function for multivariate distributions

§Arguments
  • x - Point at which to evaluate the PDF
§Returns

The probability density at x

Source

fn rvs(&self, size: usize) -> StatsResult<Array2<F>>

Generate random samples from the multivariate distribution

§Arguments
  • size - Number of samples to generate
§Returns

A matrix where each row is a sample

Source

fn mean(&self) -> Array1<F>

Mean vector of the distribution

Source

fn cov(&self) -> Array2<F>

Covariance matrix of the distribution

Source

fn dim(&self) -> usize

Dimensionality of the distribution

Provided Methods§

Source

fn logpdf(&self, x: &Array1<F>) -> F

Log probability density function for multivariate distributions

Source

fn rvs_single(&self) -> StatsResult<Vec<F>>

Generate a single random sample from the multivariate distribution

Implementors§