bdm::emix Class Reference

Mixture of epdfs. More...

#include <emix.h>

Inheritance diagram for bdm::emix:

Inheritance graph
[legend]
Collaboration diagram for bdm::emix:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 emix (const RV &rv)
 Default constructor.
void set_parameters (const vec &w, const Array< epdf * > &Coms, bool copy=true)
vec sample () const
 Returns a sample, $x$ from density $epdf(rv)$.
vec mean () const
 return expected value
vec variance () const
 return expected variance (not covariance!)
double evallog (const vec &val) const
 Compute log-probability of argument val.
vec evallog_m (const mat &Val) const
 Compute log-probability of multiple values argument val.
mat evallog_M (const mat &Val) const
 Auxiliary function that returns pdflog for each component.
emixmarginal (const RV &rv) const
 Return marginal density on the given RV, the remainig rvs are intergrated out.
mratiocondition (const RV &rv) const
 Return conditional density on the given RV, the remaining rvs will be in conditioning.
vec & _w ()
 returns a pointer to the internal mean value. Use with Care!
void ownComs ()
 Auxiliary function for taking ownership of the Coms().
epdf_Coms (int i)
 access function
virtual mat sample_m (int N) const
 Returns N samples from density $epdf(rv)$.
const RV_rv () const
 access function, possibly dangerous!
void _renewrv (const RV &in_rv)
 modifier function - useful when copying epdfs

Protected Attributes

vec w
 weights of the components
Array< epdf * > Coms
 Component (epdfs).
bool destroyComs
 Flag if owning Coms.
RV rv
 Identified of the random variable.


Detailed Description

Mixture of epdfs.

Density function:

\[ f(x) = \sum_{i=1}^{n} w_{i} f_i(x), \quad \sum_{i=1}^n w_i = 1. \]

where $f_i(x)$ is any density on random variable $x$, called component,


Member Function Documentation

void bdm::emix::set_parameters ( const vec &  w,
const Array< epdf * > &  Coms,
bool  copy = true 
)

Set weights w and components Coms By default Coms are copied inside. Parameter copy can be set to false if Coms live externally. Use method ownComs() if Coms should be destroyed by the destructor.

References bdm::epdf::_rv(), Coms, destroyComs, bdm::RV::equal(), bdm::epdf::rv, and w.

Referenced by marginal(), bdm::MixEF::predictor(), and bdm::mmix::set_parameters().


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

Generated on Fri Feb 6 19:50:05 2009 for mixpp by  doxygen 1.5.6