pub struct MultivariateNormal<Real, N>where
Real: RealField,
N: Dim + DimMin<N, Output = N>,
DefaultAllocator: Allocator<N> + Allocator<N, N> + Allocator<U1, N> + Allocator<<N as DimMin<N>>::Output>,{ /* private fields */ }Expand description
An N-dimensional multivariate normal distribution
See the crate-level docs for example usage.
Implementations§
Source§impl<Real, N> MultivariateNormal<Real, N>
impl<Real, N> MultivariateNormal<Real, N>
Sourcepub fn from_mean_and_precision(
mu: &OVector<Real, N>,
precision: &OMatrix<Real, N, N>,
) -> Self
pub fn from_mean_and_precision( mu: &OVector<Real, N>, precision: &OMatrix<Real, N, N>, ) -> Self
Create a multivariate normal distribution from a mean and precision
The mean vector mu is N dimensional and the precision matrix is
N x N.
Sourcepub fn from_mean_and_covariance(
mu: &OVector<Real, N>,
covariance: &OMatrix<Real, N, N>,
) -> Result<Self, Error>
pub fn from_mean_and_covariance( mu: &OVector<Real, N>, covariance: &OMatrix<Real, N, N>, ) -> Result<Self, Error>
Create a multivariate normal distribution from a mean and covariance
The mean vector mu is N dimensional and the covariance matrix is
N x N.
The precision matrix is calculated by inverting the covariance matrix using a Cholesky decomposition. This can fail if the covariance matrix is not definite positive.
Sourcepub fn pdf<Count>(&self, xs: &OMatrix<Real, Count, N>) -> OVector<Real, Count>
pub fn pdf<Count>(&self, xs: &OMatrix<Real, Count, N>) -> OVector<Real, Count>
Probability density function
Evaluate the probability density at locations xs.
Trait Implementations§
Source§impl<Real, N> Clone for MultivariateNormal<Real, N>
impl<Real, N> Clone for MultivariateNormal<Real, N>
Source§fn clone(&self) -> MultivariateNormal<Real, N>
fn clone(&self) -> MultivariateNormal<Real, N>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<Real, N> Debug for MultivariateNormal<Real, N>
impl<Real, N> Debug for MultivariateNormal<Real, N>
Auto Trait Implementations§
impl<Real, N> !Freeze for MultivariateNormal<Real, N>
impl<Real, N> !RefUnwindSafe for MultivariateNormal<Real, N>
impl<Real, N> !Send for MultivariateNormal<Real, N>
impl<Real, N> !Sync for MultivariateNormal<Real, N>
impl<Real, N> !Unpin for MultivariateNormal<Real, N>
impl<Real, N> !UnsafeUnpin for MultivariateNormal<Real, N>
impl<Real, N> !UnwindSafe for MultivariateNormal<Real, N>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.