# MixEF Class Reference

Mixture of Exponential Family Densities. More...

`#include <mixef.h>`

Inheritance diagram for MixEF:

[legend]
Collaboration diagram for MixEF:

[legend]

List of all members.

## Public Member Functions
| MixEF (const Array< BMEF * > &Coms0, const vec &alpha0)
| Full 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)
| Batch Bayes rule (columns of Dt are observations).
double | logpred (const vec &dt) const
const epdf & | _epdf () const
| Returns a pointer to the epdf representing posterior density on parameters. Use with care!
vec | logpred_m (const mat &dt) const
| Matrix version of logpred.
virtual epdf * | predictor (const RV &rv)
| Constructs a predictive density (marginal density on data).
const RV & | _rv () const
| access function
double | _ll () const
| access function
void | set_evalll (bool evl0)
| access function
virtual BM * | _copy_ (bool changerv=false)
## 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 .
multiBM | weights
| Statistics for weights.
eprod * | est
| Posterior on component parameters.
RV | rv
| Random variable of the posterior.
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.

## 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:

where is a known function of past outputs, are component weights, and component parameters are assumed to be mutually independent. is an aggregation af all component parameters and weights, i.e. .

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 approximate estimation project this class itself belongs to the exponential family.

TODO: Extend BM to use rvc.

## Member Function Documentation

void 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 BM::_copy_(), build_est(), Coms, est, n, multiBM::set_parameters(), and weights.

Referenced by merger::merge().

double 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 BM.

References multiBM::_epdf(), Coms, epdf::mean(), n, and weights.

Referenced by merger::merge().

virtual BM* BM::_copy_ | ( | bool | changerv = `false` | ) | `[inline, virtual, inherited]`

Copy function required in vectors, Arrays of BM etc. Have to be DELETED manually! Prototype: BM* _copy_(){BM Tmp*=new Tmp(this*); return Tmp; }

Reimplemented in ARX.

Referenced by init().

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

- work/git/mixpp/bdm/estim/mixef.h
- work/git/mixpp/bdm/estim/mixef.cpp