noparama
v0.0.1
Nonparametric Bayesian models
|
#include <np_mcmc.h>
Public Member Functions | |
MCMC (std::default_random_engine &generator, InitClusters &init_clusters, UpdateClusters &update_clusters, UpdateClusterPopulation &update_cluster_population, int subset_count, distribution_t &likelihood) | |
void | run (dataset_t &dataset, int T) |
const membertrix & | getMembershipMatrix () const |
const membertrix & | getMaxLikelihoodMatrix () const |
Protected Member Functions | |
void | considerMaxLikelihood () |
The MCMC class can be equiped with InitCluster, UpdateCluster, and UpdateClusterPopulation objects that each will be used in a Monte-Carlo Monte Chain algorithm. This algorithm is run for T steps and returns a membership matrix in the form of a membertrix object.
MCMC::MCMC | ( | std::default_random_engine & | generator, |
InitClusters & | init_clusters, | ||
UpdateClusters & | update_clusters, | ||
UpdateClusterPopulation & | update_cluster_population, | ||
int | subset_count, | ||
distribution_t & | likelihood | ||
) |
Constructor for MCMC.
[in] | generator | A random number generator |
[in] | init_clusters | An object that initializes clusters |
[in] | update_clusters | An object that updates the cluster parameters |
[in] | update_cluster_population | An object that generates and removes clusters |
|
protected |
Calculate maximum likelihood of current assignments
[out] _max_likelihood_membertrix The max likelihood membership matrix up to now [out] _max_likelihood The max likelihood up to now
const membertrix & MCMC::getMaxLikelihoodMatrix | ( | ) | const |
const membertrix & MCMC::getMembershipMatrix | ( | ) | const |
The results of the MCMC algorithm is a membership matrix.
void MCMC::run | ( | dataset_t & | dataset, |
int | T | ||
) |