gplib  1.0.0
C++ Gaussian Process Library
mvgauss.hpp
Go to the documentation of this file.
1 #ifndef GPLIB_MVGAUSS
2 #define GPLIB_MVGAUSS
3 
4 #include <armadillo>
5 #include <vector>
6 
7 namespace gplib {
8 
9  class mv_gauss {
13  private:
16  public:
20  mv_gauss();
26  mv_gauss(const mv_gauss &other);
33  mv_gauss(const arma::vec &mean, const arma::mat &cov);
34 
38  ~mv_gauss();
39 
44  void set_mean(const arma::vec &mean);
49  void set_cov(const arma::mat &cov);
53  arma::vec get_mean() const;
57  arma::mat get_cov() const;
61  arma::mat get_cov_inv() const;
65  arma::mat get_cov_chol() const;
69  size_t dimension() const;
70 
76  arma::mat sample(int n_samples) const;
77 
82  double log_density(const arma::vec &x) const;
87  double density(const arma::vec &x) const;
88 
96  mv_gauss marginalize_hidden(const std::vector<bool> &observed) const;
97 
105  mv_gauss conditional(const arma::vec &observation,
106  const std::vector<bool> &observed) const;
107 
112  mv_gauss operator=(const mv_gauss &other);
113  };
114 };
115 
116 #endif
Definition: mvgauss.hpp:9
mv_gauss()
Constructor.
Definition: mvgauss.cc:62
implementation * pimpl
Definition: mvgauss.hpp:14
arma::mat get_cov_chol() const
Returns the cholesky decomposition of the covanriance matrix.
Definition: mvgauss.cc:99
void set_cov(const arma::mat &cov)
Sets the covariance matrix to the Gaussian distribution.
Definition: mvgauss.cc:86
mv_gauss operator=(const mv_gauss &other)
Overload of the operand = to work with Multivariate Gaussian class.
Definition: mvgauss.cc:133
double density(const arma::vec &x) const
Returns the density of the Gaussian ditribution.
Definition: mvgauss.cc:117
size_t dimension() const
Returns the dimensionality of the Gaussian ditribution.
Definition: mvgauss.cc:108
arma::mat get_cov() const
Gets the covanriance matrix.
Definition: mvgauss.cc:95
arma::mat get_cov_inv() const
Returns the inverse of the covanriance matrix.
Definition: mvgauss.cc:103
arma::mat sample(int n_samples) const
Returns n_samples samples in a matrix with n_samples rows and D columns.
Definition: mvgauss.cc:121
Definition: basic.cc:6
arma::vec get_mean() const
Gets the mean vector.
Definition: mvgauss.cc:91
double log_density(const arma::vec &x) const
Returns the logartihm density of the Gaussian distribution.
Definition: mvgauss.cc:112
Definition: mvgauss.cc:8
mv_gauss marginalize_hidden(const std::vector< bool > &observed) const
Returns the marginal distribution after integrating out the non observed variables.
Definition: mvgauss.cc:125
~mv_gauss()
Destructor.
Definition: mvgauss.cc:78
mv_gauss conditional(const arma::vec &observation, const std::vector< bool > &observed) const
Returns the conditional distribution of the hidden variables given the an observation of the observed...
Definition: mvgauss.cc:129
void set_mean(const arma::vec &mean)
Sets the mean vector to the Gaussian distribution.
Definition: mvgauss.cc:82