Struct nalgebra_mvn::MultivariateNormal [−][src]
pub struct MultivariateNormal<Real, N> where
Real: RealField,
N: Dim + DimMin<N, Output = N>,
DefaultAllocator: Allocator<Real, N>,
DefaultAllocator: Allocator<Real, N, N>,
DefaultAllocator: Allocator<Real, U1, N>,
DefaultAllocator: Allocator<(usize, usize), <N as DimMin<N>>::Output>, { /* fields omitted */ }
Expand description
An N
-dimensional multivariate normal distribution
See the crate-level docs for example usage.
Implementations
impl<Real, N> MultivariateNormal<Real, N> where
Real: RealField,
N: Dim + DimMin<N, Output = N> + DimSub<Dynamic>,
DefaultAllocator: Allocator<Real, N>,
DefaultAllocator: Allocator<Real, N, N>,
DefaultAllocator: Allocator<Real, U1, N>,
DefaultAllocator: Allocator<(usize, usize), <N as DimMin<N>>::Output>,
impl<Real, N> MultivariateNormal<Real, N> where
Real: RealField,
N: Dim + DimMin<N, Output = N> + DimSub<Dynamic>,
DefaultAllocator: Allocator<Real, N>,
DefaultAllocator: Allocator<Real, N, N>,
DefaultAllocator: Allocator<Real, U1, N>,
DefaultAllocator: Allocator<(usize, usize), <N as DimMin<N>>::Output>,
pub 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.
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.
pub fn pdf<Count>(&self, xs: &OMatrix<Real, Count, N>) -> OVector<Real, Count> where
Count: Dim,
DefaultAllocator: Allocator<Real, Count>,
DefaultAllocator: Allocator<Real, N, Count>,
DefaultAllocator: Allocator<Real, Count, N>,
DefaultAllocator: Allocator<Real, Count, Count>,
pub fn pdf<Count>(&self, xs: &OMatrix<Real, Count, N>) -> OVector<Real, Count> where
Count: Dim,
DefaultAllocator: Allocator<Real, Count>,
DefaultAllocator: Allocator<Real, N, Count>,
DefaultAllocator: Allocator<Real, Count, N>,
DefaultAllocator: Allocator<Real, Count, Count>,
Probability density function
Evaluate the probability density at locations xs
.
pub fn logpdf<Count>(
&self,
xs: &OMatrix<Real, Count, N>
) -> OVector<Real, Count> where
Count: Dim,
DefaultAllocator: Allocator<Real, Count>,
DefaultAllocator: Allocator<Real, N, Count>,
DefaultAllocator: Allocator<Real, Count, N>,
DefaultAllocator: Allocator<Real, Count, Count>,
pub fn logpdf<Count>(
&self,
xs: &OMatrix<Real, Count, N>
) -> OVector<Real, Count> where
Count: Dim,
DefaultAllocator: Allocator<Real, Count>,
DefaultAllocator: Allocator<Real, N, Count>,
DefaultAllocator: Allocator<Real, Count, N>,
DefaultAllocator: Allocator<Real, Count, Count>,
Log of the probability density function
Evaluate the log probability density at locations xs
.
Trait Implementations
impl<Real: Clone, N: Clone> Clone for MultivariateNormal<Real, N> where
Real: RealField,
N: Dim + DimMin<N, Output = N>,
DefaultAllocator: Allocator<Real, N>,
DefaultAllocator: Allocator<Real, N, N>,
DefaultAllocator: Allocator<Real, U1, N>,
DefaultAllocator: Allocator<(usize, usize), <N as DimMin<N>>::Output>,
impl<Real: Clone, N: Clone> Clone for MultivariateNormal<Real, N> where
Real: RealField,
N: Dim + DimMin<N, Output = N>,
DefaultAllocator: Allocator<Real, N>,
DefaultAllocator: Allocator<Real, N, N>,
DefaultAllocator: Allocator<Real, U1, N>,
DefaultAllocator: Allocator<(usize, usize), <N as DimMin<N>>::Output>,
impl<Real: Debug, N: Debug> Debug for MultivariateNormal<Real, N> where
Real: RealField,
N: Dim + DimMin<N, Output = N>,
DefaultAllocator: Allocator<Real, N>,
DefaultAllocator: Allocator<Real, N, N>,
DefaultAllocator: Allocator<Real, U1, N>,
DefaultAllocator: Allocator<(usize, usize), <N as DimMin<N>>::Output>,
impl<Real: Debug, N: Debug> Debug for MultivariateNormal<Real, N> where
Real: RealField,
N: Dim + DimMin<N, Output = N>,
DefaultAllocator: Allocator<Real, N>,
DefaultAllocator: Allocator<Real, N, N>,
DefaultAllocator: Allocator<Real, U1, N>,
DefaultAllocator: Allocator<(usize, usize), <N as DimMin<N>>::Output>,
Auto Trait Implementations
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
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.