Thesis docs
|
Computes log-likelihood for clusters based on distance-based cohesion and repulsion. More...
#include <Likelihood.hpp>
Public Member Functions | |
Likelihood (const Data &data, const Params ¶m) | |
Constructs a Likelihood object. | |
double | cluster_loglikelihood (int cluster_index) const |
Calculates the full log-likelihood of a cluster. | |
double | cluster_loglikelihood (int cluster_index, const Eigen::VectorXi &cls_ass_k) const |
Calculates the full log-likelihood of a cluster with explicit assignments. | |
double | point_loglikelihood_cond (int point_index, int cluster_index) const |
Calculates the conditional log-likelihood of assigning a point to a cluster. | |
double | point_loglikelihood_cond (int point_index, int cluster_index, const Eigen::VectorXi &cls_ass_k) const |
Calculates the conditional log-likelihood with explicit cluster assignments. | |
Computes log-likelihood for clusters based on distance-based cohesion and repulsion.
This class implements a likelihood model that encourages points within clusters to be close (cohesion) while clusters are pushed apart (repulsion). The model uses gamma priors on distance distributions.
Constructs a Likelihood object.
data | Reference to Data object with distances and allocations |
param | Reference to model parameters |
double Likelihood::cluster_loglikelihood | ( | int | cluster_index | ) | const |
Calculates the full log-likelihood of a cluster.
Computes both cohesion (within-cluster) and repulsion (between-cluster) components for all points in the specified cluster
cluster_index | Index of the cluster to evaluate |
double Likelihood::cluster_loglikelihood | ( | int | cluster_index, |
const Eigen::VectorXi & | cls_ass_k ) const |
Calculates the full log-likelihood of a cluster with explicit assignments.
Overloaded version that accepts cluster assignments directly
cluster_index | Index of the cluster to evaluate |
cls_ass_k | Vector of point indices in the cluster |
double Likelihood::point_loglikelihood_cond | ( | int | point_index, |
int | cluster_index ) const |
Calculates the conditional log-likelihood of assigning a point to a cluster.
Computes how likely a point is to belong to a cluster, considering both its cohesion with the cluster and repulsion from other clusters
point_index | Index of the point to evaluate |
cluster_index | Index of the target cluster (can be K for new cluster) |
double Likelihood::point_loglikelihood_cond | ( | int | point_index, |
int | cluster_index, | ||
const Eigen::VectorXi & | cls_ass_k ) const |
Calculates the conditional log-likelihood with explicit cluster assignments.
Overloaded version that accepts cluster assignments directly
point_index | Index of the point to evaluate |
cluster_index | Index of the target cluster |
cls_ass_k | Vector of point indices in the cluster |