bdm::MixEF Class Reference

Mixture of Exponential Family Densities. More...


Detailed Description

Mixture of Exponential Family Densities.

An approximate estimation method for models with latent discrete variable, such as mixture models of the following kind:

\[ f(y_t|\psi_t, \Theta) = \sum_{i=1}^{n} w_i f(y_t|\psi_t, \theta_i) \]

where $\psi$ is a known function of past outputs, $w=[w_1,\ldots,w_n]$ are component weights, and component parameters $\theta_i$ are assumed to be mutually independent. $\Theta$ is an aggregation af all component parameters and weights, i.e. $\Theta = [\theta_1,\ldots,\theta_n,w]$.

The characteristic feature of this model is that if the exact values of the latent variable were known, estimation of the parameters can be handled by a single model. For example, for the case of mixture models, posterior density for each component parameters would be a BayesianModel from Exponential Family.

This class uses EM-style type algorithms for estimation of its parameters. Under this simplification, the posterior density is a product of exponential family members, hence under EM-style approximate estimation this class itself belongs to the exponential family.

TODO: Extend BM to use rvc.

#include <mixtures.h>

List of all members.

Public Member Functions

 MixEF (const Array< BMEF * > &Coms0, const vec &alpha0)
 Full constructor.
 MixEF ()
 Constructor of empty mixture.
 MixEF (const MixEF &M2)
 Copy constructor.
void init (BMEF *Com0, const mat &Data, int c=5)
void bayes (const vec &dt)
 Recursive EM-like algorithm (QB-variant), see Karny et. al, 2006.
void bayes (const mat &dt)
 EM algorithm.
void bayesB (const mat &dt, const vec &wData)
double logpred (const vec &dt) const
const epdfposterior () const
emixepredictor () const
 Constructs a predictive density $ f(d_{t+1} |d_{t}, \ldots d_{0}) $.
void flatten (const BMEF *M2)
 Flatten the density as if it was not estimated from the data.
BMEF_Coms (int i)
 Access function.
void set_method (MixEF_METHOD M)
 Set which method is to be used.
virtual void set_statistics (const BMEF *BM0)
 get statistics from another model
virtual void bayes (const vec &data, const double w)
 Weighted update of sufficient statistics (Bayes rule).
virtual void flatten (const BMEF *B)
 Flatten the posterior according to the given BMEF (of the same type!).
BMEF_copy_ () const
void from_setting (const Setting &set)
 This method arrange instance properties according the data stored in the Setting structure.
virtual string to_string ()
 This method returns a basic info about the current instance.
virtual void to_setting (Setting &set) const
 This method save all the instance properties into the Setting structure.
virtual void validate ()
 This method TODO.
Mathematical operations



virtual void bayesB (const mat &Dt)
 Batch Bayes rule (columns of Dt are observations).
vec logpred_m (const mat &dt) const
 Matrix version of logpred.
virtual mpdfpredictor () const
 Constructs conditional density of 1-step ahead predictor $ f(d_{t+1} |d_{t+h-1}, \ldots d_{t}) $.
Access to attributes



const RV_drv () const
void set_drv (const RV &rv)
void set_rv (const RV &rv)
double _ll () const
void set_evalll (bool evl0)

Protected Member Functions

void build_est ()
 Auxiliary function for use in constructors.

Protected Attributes

int n
 Number of components.
Array< BMEF * > Coms
 Models for Components of $\theta_i$.
multiBM weights
 Statistics for weights.
eprodest
 Posterior on component parameters.
MixEF_METHOD method
 Flag for a method that is used in the inference.
double frg
 forgetting factor
double last_lognc
 cached value of lognc() in the previous step (used in evaluation of ll )
RV drv
 Random variable of the data (optional).
double ll
 Logarithm of marginalized data likelihood.
bool evalll
 If true, the filter will compute likelihood of the data record and store it in ll . Set to false if you want to save computational time.

Extension to conditional BM

This extension is useful e.g. in Marginalized Particle Filter (bdm::MPF). Alternatively, it can be used for automated connection to DS when the condition is observed



const RV_rvc () const
 access function
virtual void condition (const vec &val)
 Substitute val for rvc.
RV rvc
 Name of extension variable.

Logging of results



virtual void set_options (const string &opt)
 Set boolean options from a string, recognized are: "logbounds,logll".
virtual void log_add (logger &L, const string &name="")
 Add all logged variables to a logger.
virtual void logit (logger &L)
ivec LIDs
 IDs of storages in loggers 4:[1=mean,2=lb,3=ub,4=ll].
ivec LFlags
 Flags for logging - same size as LIDs, each entry correspond to the same in LIDs.

Member Function Documentation

BMEF* bdm::BMEF::_copy_ (  )  const [inline, virtual, inherited]

Copy function required in vectors, Arrays of BM etc. Have to be DELETED manually! Prototype:

 BM* _copy_() const {return new BM(*this);} 

Reimplemented from bdm::BM.

Reimplemented in bdm::ARX.

References bdm_error.

Referenced by init().

void bdm::MixEF::init ( BMEF Com0,
const mat &  Data,
int  c = 5 
)

Initializing the mixture by a random pick of centroids from data

Parameters:
Com0 Initial component - necessary to determine its type.
Data Data on which the initialization will be done
c Initial number of components, default=5

References bdm::BMEF::_copy_(), build_est(), Coms, est, n, bdm::multiBM::set_parameters(), and weights.

Referenced by bdm::merger_mix::merge().

double bdm::MixEF::logpred ( const vec &  dt  )  const [virtual]

Evaluates predictive log-likelihood of the given data record I.e. marginal likelihood of the data with the posterior integrated out.

Reimplemented from bdm::BM.

References Coms, bdm::eDirich::mean(), bdm::multiBM::posterior(), and weights.

Referenced by bdm::merger_mix::evallog(), and bdm::merger_mix::merge().


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

Generated on Sun Sep 13 23:08:56 2009 for mixpp by  doxygen 1.6.1