33 std::vector<std::shared_ptr<Module>>
modules;
45 const std::vector<std::shared_ptr<Module>> &mods)
82 [[nodiscard]] Eigen::VectorXd
140 int size_old_cj)
const override;
156 int ci,
int cj)
const override;
Base class for modules used in processes.
Normalized Generalized Gamma Process (NGGP) implementation for Bayesian nonparametric clustering.
Manages distance matrices and cluster allocations for points.
Definition Data.hpp:26
U_sampler & U_sampler_method
Reference to the U_sampler instance for updating the latent variable U.
Definition NGGP.hpp:41
NGGP(Data &d, NGGP_params &p, U_sampler &mh)
Constructor for the Normalized Generalized Gamma Process.
Definition NGGP.hpp:70
double prior_ratio_merge(int size_old_ci, int size_old_cj) const override
Computes the prior ratio for a merge operation in a spatially-aware NGGP-based split-merge MCMC algor...
Definition NGGPx.cpp:65
double gibbs_prior_existing_cluster(int cls_idx, int obs_idx=0) const override
Computes the log prior probability of assigning a data point to an existing cluster.
Definition NGGPx.cpp:15
double gibbs_prior_new_cluster_obs(int obs_idx) const override
Observation-specific new-cluster prior.
Definition NGGPx.cpp:42
NGGPx(Data &d, NGGP_params &p, U_sampler &U_sam, const std::vector< std::shared_ptr< Module > > &mods)
Construct an NGGPWx process.
Definition NGGPx.hpp:44
double prior_ratio_shuffle(int size_old_ci, int size_old_cj, int ci, int cj) const override
Computes the prior ratio for a shuffle operation in a spatially-aware NGGP-based split-merge MCMC alg...
Definition NGGPx.cpp:85
std::vector< std::shared_ptr< Module > > modules
Definition NGGPx.hpp:33
void update_params() override
Update process parameters.
Definition NGGPx.hpp:173
double gibbs_prior_new_cluster() const override
Computes the log prior probability of assigning a data point to a new cluster.
Definition NGGPx.cpp:40
double prior_ratio_split(int ci, int cj) const override
Computes the prior ratio for a split operation in a spatially-aware NGGP-based split-merge MCMC algor...
Definition NGGPx.cpp:52
Eigen::VectorXd gibbs_prior_existing_clusters(int obs_idx) const override
Computes the log prior for assigning an observation to each existing cluster.
Definition NGGPx.cpp:28
const Eigen::VectorXi & old_allocations_view() const
Provides read-only access to the stored previous allocations.
Definition Process.hpp:236
const std::unordered_map< int, std::vector< int > > & old_cluster_members_view() const
Provides read-only access to the stored previous cluster members.
Definition Process.hpp:63
Abstract base class for MCMC sampling of the latent variable U.
Definition U_sampler.hpp:28
Struct for storing parameters of the NGGP (Normalized Generalized Gamma Process).
Definition NGGP-params.hpp:28