48 mutable std::mt19937 gen;
67 bool shuffle_bool =
false;
72 Eigen::VectorXi launch_state;
78 Eigen::VectorXi original_allocations;
84 double log_split_gibbs_prob = 0;
88 double log_merge_gibbs_prob = 0;
91 int accepted_split = 0;
92 int accepted_merge = 0;
93 int accepted_shuffle = 0;
103 void choose_indeces();
111 void choose_clusters_shuffle();
126 void restricted_gibbs(
int iterations,
bool only_probabilities =
false);
148 double compute_acceptance_ratio_split(
double likelihood_old_cluster);
167 double compute_acceptance_ratio_merge(
double likelihood_old_ci,
168 double likelihood_old_cj);
189 double compute_acceptance_ratio_shuffle(
double likelihood_old_ci,
190 double likelihood_old_cj,
191 int old_ci_size,
int old_cj_size);
210 :
Sampler(d, p, l, pr), shuffle_bool(shuffle), gen(
rd()) {};
226 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
SplitMerge(Data &d, Params &p, Likelihood &l, Process &pr, bool shuffle)
Constructor for Split-Merge sampler.
Definition splitmerge.hpp:209
void step() override
Perform one iteration of the split-merge algorithm.
Definition splitmerge.cpp:389
int get_accepted_split() const
Get number of accepted split moves for diagnostics.
Definition splitmerge.hpp:233
int get_accepted_merge() const
Get number of accepted merge moves for diagnostics.
Definition splitmerge.hpp:239
int get_accepted_shuffle() const
Get number of accepted shuffle moves for diagnostics.
Definition splitmerge.hpp:245
Structure containing all parameters needed for the NGGP (Normalized Generalized Gamma Process) and DP...
Definition Params.hpp:35