bdm::MixEF Class Reference
Mixture of Exponential Family Densities. More...
#include <mixtures.h>
Inheritance diagram for bdm::MixEF:
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, const int c=5) |
void | bayes (const vec &yt, const vec &cond) |
Recursive EM-like algorithm (QB-variant), see Karny et. al, 2006. | |
double | bayes_batch_weighted (const mat &yt, const mat &cond, const vec &wData) |
batch weighted Bayes rule | |
double | bayes_batch (const mat &yt, const mat &cond) |
double | logpred (const vec &yt, const vec &cond) const |
const eprod_mix & | posterior () const |
return correctly typed posterior (covariant return) | |
emix * | epredictor (const vec &cond=vec()) const |
void | flatten (const BMEF *M2, double weight) |
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. | |
void | to_setting (Setting &set) const |
void | from_setting (const Setting &set) |
Protected Attributes | |
Array< BMEF * > | Coms |
Models for Components of . | |
multiBM | weights |
Statistics for weights. | |
bdm::MixEF::eprod_mix | est |
Posterior on component parameters. | |
Options | options |
Friends | |
class | eprod_mix |
Classes | |
class | eprod_mix |
Posterior on component parameters. More... | |
class | Options |
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 under EM-style approximate estimation this class itself belongs to the exponential family.
Two methods are provided:
- QB where the probability of being from one component is computed using predictors,
- EM where the data is assigned to component with the highest likelihood (winner takes all)
These methods are stored in attribute options:
- method: ["EM","QB"] estimation method as mentioned above, QB is default
- max_niter: maximum of iterations in bayes_batch()
Member Function Documentation
void bdm::MixEF::from_setting | ( | const Setting & | set | ) | [inline, virtual] |
Create object from the following structure
class = 'MixEF'; Coms = { list of bdm::BMEF }; % list of components containing any offsprings of Bayesian models BMEF, bdm::BMEF::from_setting weights = [...]; % vector containing weights of components --- optional fields --- options = configuration of bdm::MixEF::Options; % see MixEF::Options, bdm::MixEF::Options::from_setting --- inherited fields --- bdm::BMEF::from_setting
Reimplemented from bdm::BMEF.
void bdm::MixEF::init | ( | BMEF * | Com0, | |
const mat & | Data, | |||
const 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 when the number of data records (columns of Data) is equal to the number of requested components, each data is used, otherwise, they are picked randomly.
The documentation for this class was generated from the following files:
- mixtures.h
- mixtures.cpp
Generated on 2 Dec 2013 for mixpp by 1.4.7