Skip to main content

MatrixNormal

Struct MatrixNormal 

Source
pub struct MatrixNormal { /* private fields */ }
Expand description

Matrix normal distribution over real matrices.

Implementations§

Source§

impl MatrixNormal

Source

pub fn new( mean: DMatrix<f64>, row_cov: DMatrix<f64>, col_cov: DMatrix<f64>, ) -> Result<MatrixNormal, String>

Construct a matrix normal distribution with mean matrix mean, row covariance row_cov, and column covariance col_cov.

§Errors

Returns Err if covariance dimensions do not match the mean or either covariance is not symmetric positive-definite.

Trait Implementations§

Source§

impl Display for MatrixNormal

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<R: Rng + ?Sized> Distribution<R> for MatrixNormal

Source§

type Domain = Matrix<f64, Dyn, Dyn, VecStorage<f64, Dyn, Dyn>>

The type of values produced by this distribution.
Source§

fn sample(&self, rng: &mut R) -> DMatrix<f64>

Draw one random sample from this distribution.
Source§

fn log_prob(&self, x: &DMatrix<f64>) -> f64

Compute the log probability (discrete) or log probability density (continuous) of observing x under this distribution. Read more
Source§

fn is_discrete(&self) -> bool

Returns true if this distribution is discrete (e.g. Bernoulli, Poisson), or false if it is continuous (e.g. Normal). Read more
Source§

fn log_cum_prob(&self, _x: &Self::Domain) -> f64

Compute log P(X <= x) for discrete distributions, or the log CDF for continuous distributions. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V