Public Member Functions | Protected Attributes | List of all members
o2scl::prob_cond_mdim_gaussian< vec_t, mat_t > Class Template Reference

A multi-dimensional Gaussian conditional probability density function. More...

#include <prob_dens_func.h>

Inheritance diagram for o2scl::prob_cond_mdim_gaussian< vec_t, mat_t >:
o2scl::prob_cond_mdim< vec_t >

Detailed Description

template<class vec_t = boost::numeric::ublas::vector<double>, class mat_t = boost::numeric::ublas::matrix<double>>
class o2scl::prob_cond_mdim_gaussian< vec_t, mat_t >

This class is experimental.

Todo:
This should be a symmetric conditional probability, i.e. $ P(x|y) = P(y|x) $. Test this.

Definition at line 1451 of file prob_dens_func.h.

Public Member Functions

 prob_cond_mdim_gaussian ()
 Create an empty distribution.
 
 prob_cond_mdim_gaussian (size_t p_ndim, mat_t &covar)
 Create a distribution from the covariance matrix.
 
virtual size_t dim () const
 The dimensionality.
 
void set (size_t p_ndim, mat_t &covar)
 Set the covariance matrix for the distribution.
 
virtual double pdf (const vec_t &x, const vec_t &x2) const
 The conditional probability.
 
virtual double log_pdf (const vec_t &x, const vec_t &x2) const
 The log of the conditional probability.
 
virtual void operator() (const vec_t &x, vec_t &x2) const
 Sample the distribution.
 
- Public Member Functions inherited from o2scl::prob_cond_mdim< vec_t >
virtual double log_metrop_hast (const vec_t &x_B, vec_t &x_A) const
 Sample the distribution and return the log of the Metropolis-Hastings ratio. More...
 

Protected Attributes

mat_t chol
 Cholesky decomposition.
 
mat_t covar_inv
 Inverse of the covariance matrix.
 
double norm
 Normalization factor.
 
size_t ndim
 Number of dimensions.
 
vec_t q
 Temporary storage 1.
 
vec_t vtmp
 Temporary storage 2.
 
o2scl::prob_dens_gaussian pdg
 Standard normal.
 

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

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).