PositiveDefiniteConstraint Class Reference

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

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. More...

 
template
<
typename
Archive
>
static void serialize (Archive &, const unsigned int)
 Serialize the constraint (which stores nothing, so, nothing to do). More...

 

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.

Definition at line 27 of file positive_definite_constraint.hpp.

Member Function Documentation

◆ ApplyConstraint() [1/2]

static void 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.

Definition at line 36 of file positive_definite_constraint.hpp.

◆ ApplyConstraint() [2/2]

static void ApplyConstraint ( arma::vec &  diagCovariance)
inlinestatic

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.

Definition at line 70 of file positive_definite_constraint.hpp.

◆ serialize()

static void serialize ( Archive &  ,
const unsigned  int 
)
inlinestatic

Serialize the constraint (which stores nothing, so, nothing to do).

Definition at line 95 of file positive_definite_constraint.hpp.


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