34 std::vector<std::shared_ptr<Module>>
modules;
70 int obs_idx)
const override;
81 [[nodiscard]] Eigen::VectorXd
133 int size_old_cj)
const override;
149 int ci,
int cj)
const override;
Dirichlet Process implementation for Bayesian nonparametric clustering.
Base class for modules used in processes.
DP(Data &d, DP_params &p)
Constructor for the Dirichlet Process.
Definition DP.hpp:30
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 split-merge MCMC.
Definition DPx.cpp:111
double prior_ratio_split(int ci, int cj) const override
Computes the prior ratio for a split operation in split-merge MCMC.
Definition DPx.cpp:61
DPx(Data &d, DP_params &p, const std::vector< std::shared_ptr< Module > > &mods)
Constructor for the Dirichlet Process with modules.
Definition DPx.hpp:45
void update_params() override
Updates the module-based parameters.
Definition DPx.hpp:159
std::vector< std::shared_ptr< Module > > modules
Definition DPx.hpp:34
double gibbs_prior_new_cluster_obs(int obs_idx) const override
Observation-specific new-cluster prior.
Definition DPx.cpp:51
Eigen::VectorXd gibbs_prior_existing_clusters(int obs_idx) const override
Computes the log prior probabilities of assigning a data point to every existing cluster....
Definition DPx.cpp:16
double gibbs_prior_existing_cluster(int cls_idx, int obs_idx) const override
Computes the log prior probability of assigning a data point to an existing cluster.
Definition DPx.cpp:39
double prior_ratio_merge(int size_old_ci, int size_old_cj) const override
Computes the prior ratio for a merge operation in split-merge MCMC.
Definition DPx.cpp:83
double gibbs_prior_new_cluster() const override
Computes the log prior probability of assigning a data point to a new cluster.
Definition DPx.cpp:49
Manages distance matrices and cluster allocations for points.
Definition Data.hpp:26
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
Struct for storing parameters of the DP (Dirichlet Process).
Definition DP-params.hpp:26