% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/internal.R
\name{.compute_cluster_probs}
\alias{.compute_cluster_probs}
\title{Compute cluster membership probabilities from PSM}
\usage{
.compute_cluster_probs(z_matrix, labels_representative, PSM)
}
\arguments{
\item{z_matrix}{Integer matrix (iterations x N) of cluster assignments.}

\item{labels_representative}{Integer vector of representative cluster labels.}

\item{PSM}{Posterior similarity matrix (N x N).}
}
\value{
N x K matrix of cluster membership probabilities.
}
\description{
For each observation, computes the probability of membership in each cluster
defined by the representative clustering, derived from the posterior
similarity matrix.
}
\details{
The representative labels define a reference partition with clusters
\eqn{C_1, \dots, C_K}. For each observation \eqn{i}, this helper averages the
posterior similarity scores \eqn{\mathrm{PSM}_{ij}} over members
\eqn{j \in C_k} to obtain a cluster-membership score for cluster \eqn{k}, and
then normalizes those scores to sum to one across clusters.
}
\keyword{internal}
