Thesis docs
Loading...
Searching...
No Matches
Likelihood Class Reference

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 &param)
 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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Likelihood()

Likelihood::Likelihood ( const Data & data,
const Params & param )
inline

Constructs a Likelihood object.

Parameters
dataReference to Data object with distances and allocations
paramReference to model parameters

Member Function Documentation

◆ cluster_loglikelihood() [1/2]

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

Parameters
cluster_indexIndex of the cluster to evaluate
Returns
Total log-likelihood of the cluster

◆ cluster_loglikelihood() [2/2]

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

Parameters
cluster_indexIndex of the cluster to evaluate
cls_ass_kVector of point indices in the cluster
Returns
Total log-likelihood of the cluster

◆ point_loglikelihood_cond() [1/2]

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

Parameters
point_indexIndex of the point to evaluate
cluster_indexIndex of the target cluster (can be K for new cluster)
Returns
Conditional log-likelihood of the point given the cluster

◆ point_loglikelihood_cond() [2/2]

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

Parameters
point_indexIndex of the point to evaluate
cluster_indexIndex of the target cluster
cls_ass_kVector of point indices in the cluster
Returns
Conditional log-likelihood of the point given the cluster

The documentation for this class was generated from the following files: