45 std::random_device
rd;
48 mutable std::mt19937
gen;
Data structure for managing point distances and cluster allocations.
Parameter management for Bayesian nonparametric MCMC models.
Manages distance matrices and cluster allocations for points.
Definition Data.hpp:27
double get_U() const
Getter for the current value of U.
Definition U_sampler.hpp:170
int total_iterations
Counter for total MCMC iterations performed.
Definition U_sampler.hpp:39
virtual ~U_sampler()=default
Virtual destructor for the U_sampler class.
U_sampler(Params &p, Data &d)
Constructor for the U_sampler class.
Definition U_sampler.hpp:154
std::random_device rd
Random device for seeding.
Definition U_sampler.hpp:45
const int n
Number of observations n.
Definition U_sampler.hpp:63
std::mt19937 gen
Mersenne Twister random number generator.
Definition U_sampler.hpp:48
Data & data
Reference to the data object containing observations and cluster assignments.
Definition U_sampler.hpp:36
double log_conditional_density_V(double v) const
Computes the log conditional density of V = log(U) given the partition.
Definition U_sampler.cpp:27
double U
Current value of the latent variable U (initialized to 1.0).
Definition U_sampler.hpp:66
virtual void update_U()=0
Pure virtual method to update the latent variable U.
const double tau_power_sigma
Pre-computed tau^sigma for efficient computation.
Definition U_sampler.hpp:60
Params & params
Reference to the parameters object containing NGGP parameters.
Definition U_sampler.hpp:32
const double a_over_sigma
Ratio a/sigma for efficient computation.
Definition U_sampler.hpp:57
int accepted_U
Counter of accepted U.
Definition U_sampler.hpp:42
double log_conditional_density_U(double u) const
Computes the log conditional density of U given the partition.
Definition U_sampler.cpp:9
double get_acceptance_rate() const
Getter for the acceptance rate of U updates.
Definition U_sampler.hpp:176
Structure containing all parameters needed for the NGGP (Normalized Generalized Gamma Process) and DP...
Definition Params.hpp:35