mlpack
Static Public Member Functions | List of all members
mlpack::gmm::PositiveDefiniteConstraint Class Reference

Given a covariance matrix, force the matrix to be positive definite. More...

#include <positive_definite_constraint.hpp>

Static Public Member Functions

static void ApplyConstraint (arma::mat &covariance)
 Apply the positive definiteness constraint to the given covariance matrix, and ensure each value on the diagonal is at least 1e-50. More...
 
static void ApplyConstraint (arma::vec &diagCovariance)
 Apply the positive definiteness constraint to the given diagonal covariance matrix (which is represented as a vector), and ensure each value on the diagonal is at least 1e-50.
 
template<typename Archive >
static void serialize (Archive &, const uint32_t)
 Serialize the constraint (which stores nothing, so, nothing to do).
 

Detailed Description

Given a covariance matrix, force the matrix to be positive definite.

Also force a minimum value on the diagonal, so that even if the matrix is invertible, it doesn't cause problems with Cholesky decompositions. The forcing here is also done in order to bring the condition number of the matrix under 1e5 (10k), which should help with numerical stability.

Member Function Documentation

◆ ApplyConstraint()

static void mlpack::gmm::PositiveDefiniteConstraint::ApplyConstraint ( arma::mat &  covariance)
inlinestatic

Apply the positive definiteness constraint to the given covariance matrix, and ensure each value on the diagonal is at least 1e-50.

Parameters
covarianceCovariance matrix.

The documentation for this class was generated from the following file: