Thesis docs
|
Sequential Allocation Merge-Split (SAMS) sampler for Bayesian nonparametric models. More...
#include <splitmerge_SAMS.hpp>
Public Member Functions | |
SplitMerge_SAMS (Data &d, Params &p, Likelihood &l, Process &pr, bool shuffle) | |
Constructor for SAMS (Sequential Allocation Merge-Split) sampler. | |
void | step () override |
Perform one iteration of the SAMS 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. | |
Sequential Allocation Merge-Split (SAMS) sampler for Bayesian nonparametric models.
This class implements the SAMS algorithm, a variant of the split-merge sampler that uses sequential allocation instead of restricted Gibbs sampling for proposal generation. SAMS can be more efficient than standard split-merge for certain model configurations and provides an alternative proposal mechanism.
Key differences from standard Split-Merge:
The algorithm maintains the same three types of moves (split, merge, shuffle) but uses a different mechanism for generating proposals within each move type.
@reference Dahl, D. B. and Newcomb, S. (2022). "Sequentially allocated merge-split samplers for conjugate Bayesian nonparametric models" @reference Martinez, A. F. and Mena, R. H. (2014). "On a Nonparametric Change Point Detection Model in Markovian Regimes"
|
inline |
Constructor for SAMS (Sequential Allocation Merge-Split) 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 SAMS sampler, which uses sequential allocation instead of restricted Gibbs sampling for generating proposals. This can provide computational advantages for certain model configurations.
|
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 SAMS algorithm.
Executes one step of the SAMS sampler:
The sequential allocation approach can be more efficient than restricted Gibbs sampling while maintaining the theoretical properties of split-merge.
Perform a single split-merge MCMC step. Randomly choose two indices and decide whether to propose a split or merge move.
Implements Sampler.