Thesis docs
|
Split-Merge sampler for Bayesian nonparametric mixture models. More...
#include <splitmerge.hpp>
Public Member Functions | |
SplitMerge (Data &d, Params &p, Likelihood &l, Process &pr, bool shuffle) | |
Constructor for Split-Merge sampler. | |
void | step () override |
Perform one iteration of the split-merge algorithm. | |
int | get_accepted_split () const |
Get number of accepted split moves for diagnostics. | |
int | get_accepted_merge () const |
Get number of accepted merge moves for diagnostics. | |
int | get_accepted_shuffle () const |
Get number of accepted shuffle moves for diagnostics. | |
![]() | |
Sampler (Data &d, Params &p, Likelihood &l, Process &pr) | |
Constructor initializing sampler with required components. | |
virtual | ~Sampler ()=default |
Virtual destructor for proper cleanup of derived classes. | |
Additional Inherited Members | |
![]() | |
Data & | data |
Reference to the data object containing observations and current allocations. | |
Params & | params |
Reference to the parameters object containing model hyperparameters and MCMC settings. | |
Likelihood & | likelihood |
Reference to the likelihood computation object for evaluating cluster assignments. | |
Process & | process |
Reference to the stochastic process object (DP, NGGP, DPW, NGGPW) | |
std::random_device | rd |
Random device for generating random numbers across sampling algorithms. | |
Split-Merge sampler for Bayesian nonparametric mixture models.
This class implements the split-merge algorithm, an advanced MCMC method that proposes joint updates to cluster assignments through split and merge moves. This approach can achieve better mixing than sequential Gibbs sampling, particularly for models with strong within-cluster correlations.
The algorithm alternates between three types of moves:
Each move uses restricted Gibbs sampling to generate proposals, followed by Metropolis-Hastings acceptance/rejection based on prior and likelihood ratios. The algorithm maintains detailed balance and ergodicity.
@reference Jain, S. and Neal, R. M. (2004). "A Split-Merge Markov Chain Monte Carlo Procedure for the Dirichlet Process Mixture Model" @reference Martinez, A. F. and Mena, R. H. (2014). "On a Nonparametric Change Point Detection Model in Markovian Regimes"
|
inline |
Constructor for Split-Merge sampler.
d | Reference to Data object containing observations |
p | Reference to Params object with hyperparameters |
l | Reference to Likelihood object for probability computations |
pr | Reference to Process object defining the prior |
shuffle | Flag to enable shuffle moves in addition to split-merge |
Initializes the split-merge sampler with the option to include shuffle moves. When shuffle is enabled, the algorithm can propose redistributions between existing clusters in addition to split-merge moves.
|
inline |
Get number of accepted merge moves for diagnostics.
|
inline |
Get number of accepted shuffle moves for diagnostics.
|
inline |
Get number of accepted split moves for diagnostics.
|
overridevirtual |
Perform one iteration of the split-merge algorithm.
Executes one step of the split-merge sampler:
The algorithm automatically chooses between split, merge, and shuffle moves based on the cluster assignments of the selected observations.
Perform a single split-merge MCMC step. Randomly choose two indices and decide whether to propose a split or merge move.
Implements Sampler.