31 std::vector<std::shared_ptr<Module>>
modules;
132 [[nodiscard]]
double prior_ratio_merge(
int size_old_ci,
int size_old_cj)
const override;
147 [[nodiscard]]
double prior_ratio_shuffle(
int size_old_ci,
int size_old_cj,
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:27
U_sampler & U_sampler_method
Reference to the U_sampler instance for updating the latent variable U.
Definition NGGP.hpp:38
NGGP(Data &d, Params &p, U_sampler &mh)
Constructor for the Normalized Generalized Gamma Process.
Definition NGGP.hpp:64
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, Params &p, U_sampler &U_sam, const std::vector< std::shared_ptr< Module > > &mods)
Construct an NGGPWx process.
Definition NGGPx.hpp:42
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:86
std::vector< std::shared_ptr< Module > > modules
Definition NGGPx.hpp:31
void update_params() override
Update process parameters.
Definition NGGPx.hpp:164
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:237
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:67
Abstract base class for MCMC sampling of the latent variable U.
Definition U_sampler.hpp:28
Structure containing all parameters needed for the NGGP (Normalized Generalized Gamma Process) and DP...
Definition Params.hpp:35