Struct nalgebra_mvn::MultivariateNormal
source · pub struct MultivariateNormal<Real, N>where
Real: RealField,
N: Dim + DimMin<N, Output = N>,
DefaultAllocator: Allocator<Real, N> + Allocator<Real, N, N> + Allocator<Real, U1, N> + Allocator<(usize, usize), <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 copy 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> !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<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.