KrisLibrary
1.0.0
|
Multivariate gaussian N(mu,K) of d dimensions. More...
#include <gaussian.h>
Public Types | |
typedef Gaussian< T > | MyT |
typedef VectorTemplate< T > | VectorT |
typedef MatrixTemplate< T > | MatrixT |
Public Member Functions | |
Gaussian (int d) | |
Gaussian (const MatrixT &sigma, const VectorT &mu) | |
Gaussian (const MyT &g) | |
void | resize (int d) |
int | numDims () const |
int | degeneracy () const |
Real | normalizationFactor () const |
bool | setCovariance (const MatrixT &sigma, int verbose=1) |
Covariance matrix must be symmetric, strictly positive definite. | |
void | getCovariance (MatrixT &sigma) const |
void | getVariance (VectorT &sigma) const |
void | getPrecision (MatrixT &sigma) const |
void | setMean (const VectorT &mu) |
const VectorT & | getMean () const |
bool | setMaximumLikelihood (const std::vector< VectorT > &examples, int verbose=1) |
ML estimation. | |
bool | setMaximumLikelihood (const std::vector< VectorT > &examples, const std::vector< Real > &weights, int verbose=1) |
void | setMaximumLikelihoodDiagonal (const std::vector< VectorT > &examples) |
void | setMaximumLikelihoodDiagonal (const std::vector< VectorT > &examples, const std::vector< Real > &weights) |
bool | setMaximumAPosteriori (const std::vector< VectorT > &examples, const VectorT &meanprior, T meanStrength, const MatrixT &covprior, T covStrength, int verbose=1) |
MAP estimation with inverse weishart distribution. | |
bool | setMaximumAPosteriori (const std::vector< VectorT > &examples, const std::vector< Real > &weights, const VectorT &meanprior, T meanStrength, const MatrixT &covprior, T covStrength, int verbose=1) |
void | setMaximumAPosterioriDiagonal (const std::vector< VectorT > &examples, const VectorT &meanprior, T meanStrength, const VectorT &varprior, T covStrength) |
void | setMaximumAPosterioriDiagonal (const std::vector< VectorT > &examples, const std::vector< Real > &weights, const VectorT &meanprior, T meanStrength, const VectorT &varprior, T covStrength) |
T | probability (const VectorT &x) const |
Evaluates the probability of x. | |
T | logProbability (const VectorT &x) const |
Evaluates the log-probability of x. | |
T | partialProbability (const VectorT &x, const std::vector< int > &elements) const |
Evaluates the probability of a partial setting x(elements[i])=x[i]. | |
T | logPartialProbability (const VectorT &x, const std::vector< int > &elements) const |
Evaluates the log partial probability. | |
void | generate (VectorT &x) const |
Generates a point x according to this distribution. | |
void | setJoint (const MyT &g1, const MyT &g2) |
void | setJoint (const MyT &g1, const MyT &g2, const MatrixT &corr) |
void | setMarginalized (const MyT &g, int i) |
void | setMarginalized (const MyT &g, const std::vector< int > &elements) |
void | setConditional (const MyT &g, Real xi, int i) |
void | setConditional (const MyT &g, const VectorT &x, const std::vector< int > &elements) |
T | klDivergence (const MyT &g) const |
Public Attributes | |
MatrixT | L |
Cholesky decomposition of the covariance matrix. | |
VectorT | mu |
mean | |
Multivariate gaussian N(mu,K) of d dimensions.
where c = 1/sqrt((2pi)^d |K|).
Represented by the cholesky decomposition of K = LL^t.
so sqrt(|K|) = |L| = product of diag(L). Equivalent to the change of variable y = L^-1(x-mu), such that P(x~N(mu,K)) = P(y~N(0,I))