51 mutable std::mt19937 gen;
70 bool shuffle_bool =
false;
75 Eigen::VectorXi launch_state;
81 Eigen::VectorXi original_allocations;
87 double log_split_gibbs_prob = 0;
91 double log_merge_gibbs_prob = 0;
94 int accepted_split = 0;
95 int accepted_merge = 0;
96 int accepted_shuffle = 0;
106 void choose_indeces();
114 void choose_clusters_shuffle();
130 void sequential_allocation(
int iterations,
bool only_probabilities =
false,
bool sequential =
true);
149 double compute_acceptance_ratio_split(
double likelihood_old_cluster);
168 double compute_acceptance_ratio_merge(
double likelihood_old_ci,
169 double likelihood_old_cj);
190 double compute_acceptance_ratio_shuffle(
double likelihood_old_ci,
191 double likelihood_old_cj,
192 int old_ci_size,
int old_cj_size);
211 :
Sampler(d, p, l, pr), shuffle_bool(shuffle), gen(
rd()) {};
227 void step()
override;
Abstract base class for MCMC sampling algorithms.
Manages distance matrices and cluster allocations for points.
Definition Data.hpp:26
Computes log-likelihood for clusters based on distance-based cohesion and repulsion.
Definition Likelihood.hpp:19
Abstract base class for Bayesian nonparametric processes.
Definition Process.hpp:41
Sampler(Data &d, Params &p, Likelihood &l, Process &pr)
Constructor initializing sampler with required components.
Definition Sampler.hpp:98
std::random_device rd
Random device for generating random numbers across sampling algorithms.
Definition Sampler.hpp:74
void step() override
Perform one iteration of the SAMS algorithm.
Definition splitmerge_SAMS.cpp:367
int get_accepted_shuffle() const
Get number of accepted shuffle moves for diagnostics.
Definition splitmerge_SAMS.hpp:246
int get_accepted_split() const
Get number of accepted split moves for diagnostics.
Definition splitmerge_SAMS.hpp:234
int get_accepted_merge() const
Get number of accepted merge moves for diagnostics.
Definition splitmerge_SAMS.hpp:240
SplitMerge_SAMS(Data &d, Params &p, Likelihood &l, Process &pr, bool shuffle)
Constructor for SAMS (Sequential Allocation Merge-Split) sampler.
Definition splitmerge_SAMS.hpp:210
Structure containing all parameters needed for the NGGP (Normalized Generalized Gamma Process) and DP...
Definition Params.hpp:35