Abstract base class for MCMC sampler implementations.
This class provides the foundation for implementing different MCMC sampling algorithms for Bayesian nonparametric models including Dirichlet Process (DP), Normalized Generalized Gamma Process (NGGP), and their weighted variants (DPW, NGGPW). It holds references to all necessary components and provides a unified interface for different sampling strategies.
The class supports various MCMC algorithms through derived implementations:
- Gibbs Samplers: Standard collapsed Gibbs sampling (Neal's Algorithm 3)
- Split-Merge Samplers: Advanced algorithms for better mixing (SAMS variants)
- Hybrid Approaches: Combinations of different sampling strategies
Each sampler operates on the same core components but implements different strategies for exploring the posterior distribution of cluster assignments. The composition pattern allows flexible combinations of different data types, likelihood models, process priors, and parameter configurations.
- See also
- Data, Params, Likelihood, Process
-
Neal3, SplitMerge, SplitMerge_SAMS
virtual void Sampler::step |
( |
| ) |
|
|
pure virtual |
Pure virtual method to perform one MCMC sampling step.
This method must be implemented by derived classes to define their specific sampling algorithm. Each call should update the current state of the Markov chain by sampling from the appropriate conditional distributions.
Different sampler implementations use different strategies:
- Gibbs samplers (e.g., Neal3): Sequential sampling of individual assignments
- Split-Merge samplers: Joint updates of multiple assignments via split/merge moves
- Hybrid samplers: Combinations of multiple update mechanisms
The method should update cluster assignments in the Data object and may also update auxiliary variables or hyperparameters as needed by the specific algorithm.
- Note
- This is a pure virtual function that must be overridden by concrete sampler implementations
- See also
- Neal3::step(), SplitMerge::step(), SplitMerge_SAMS::step()
Implemented in Neal3, SplitMerge, and SplitMerge_SAMS.