Posterior probability of latent class membership with two classes

Applies Bayes' rule to give the probability that a unit belongs to a class, given its observed data: the class share times the likelihood of the data under that class, divided by the same quantity summed over classes. Units are commonly allocated to their most probable class, but the probability shows how uncertain the allocation is. With K classes the denominator has K terms.

Signature

post_1 = pi_1 * f_1 / (pi_1 * f_1 + pi_2 * f_2)
Inputs
InputsDefinitionUnit
pi_1Estimated share of the population in class 1proportion
f_1Value of class 1's fitted distribution at the unit's observed dataprobability or density
pi_2Estimated share of the population in class 2, equal to 1 minus pi_1 with two classesproportion
f_2Value of class 2's fitted distribution at the unit's observed data, on the same scale as f_1probability or density
Output
post_1Probability that the unit belongs to class 1 given its dataprobability

Function

Grouping patients or other units by dissimilarity in cluster analysis

Maps the clustering variables measured on each unit, such as a patient's counts of emergency and outpatient care, to a set of groups found in the data without an outcome variable. Combinatorial methods such as k-means assign each unit to one group by minimising the dissimilarity within groups; mixture models such as latent class analysis give each unit a probability of belonging to each class. The notation follows the Cluster Analysis article, whose six-patient example is used throughout.

Try this function

Implementations

  • Excel

    Posterior class probability from named shares and likelihoods

    With ShareOne, DensOne, ShareTwo and DensTwo named, the formula returns the posterior probability of class 1, held in PostOne. For K classes in ranges Shares and Dens, =INDEX(Shares,1)*INDEX(Dens,1)/SUMPRODUCT(Shares,Dens) gives class 1.

    =ShareOne*DensOne/(ShareOne*DensOne+ShareTwo*DensTwo)

Assumptions

  • Class shares and class distributions taken from the fitted mixture model

    pi_k and f_k come from a mixture model fitted by maximum likelihood or Bayesian methods, with the shares adding to 1; the posterior inherits their estimation uncertainty.

  • Each unit belongs to exactly one latent class

    The classes are mutually exclusive and exhaustive, so the posterior probabilities for a unit add to 1.

Worked examples

  • Patient with 3 emergency attendances and a high-use class of 20 per cent

    If attendances follow a Poisson distribution with mean 5 in a high-use class holding 20 per cent of patients and mean 1 in a low-use class, 3 attendances have likelihoods of about 0.1404 and 0.0613; the posterior probability of the high-use class is about 0.364 (computed here for illustration).

    pi_1 = 0.2; f_1 = 0.140374; pi_2 = 0.8; f_2 = 0.061313; post_1 = 0.364
  • Patient with 6 emergency attendances in the same two-class model

    With 6 attendances the likelihoods are about 0.1462 and 0.0005, so the posterior probability of the high-use class is about 0.9862 (computed here for illustration).

    pi_1 = 0.2; f_1 = 0.146223; pi_2 = 0.8; f_2 = 0.000511; post_1 = 0.9862
  • Patient with 1 emergency attendance in the same two-class model

    With 1 attendance the likelihoods are about 0.0337 and 0.3679, giving a high-use probability of about 0.0224 (computed here for illustration).

    pi_1 = 0.2; f_1 = 0.03369; pi_2 = 0.8; f_2 = 0.367879; post_1 = 0.0224

Common errors

  • Treating the most probable class as certain

    The patient with 3 attendances is allocated to the low-use class with probability of only about 0.64; carrying modal classes into a model as if known hides the allocation uncertainty, which adds parameter uncertainty to any class-specific analysis.

  • Reading class shares as individual membership probabilities

    The 20 per cent share is the prior; a patient's own probability depends on the data and ranges from about 0.02 to 0.99 across the three examples.

Sources

  • Posterior probability that an observation belongs to a mixture component

    Hastie T, Tibshirani R, Friedman J. The Elements of Statistical Learning: Data Mining, Inference, and Prediction. 2nd ed. New York: Springer; 2009. Section 14.3.4: mixture models describe each cluster by a component density and are fitted by maximum likelihood or corresponding Bayesian approaches; section 6.8, equation 6.33, p. 215: the mixture model provides an estimate of the probability that observation i belongs to component m, the component share times its density at x_i divided by the sum over components; section 14.3.7, p. 511: with Gaussian components of shared scalar variance EM is a soft version of k-means, and as the variance tends to 0 the probabilities become 0 and 1 and the two methods coincide.

    View source →

  • Individuals assigned to the cluster with the maximum posterior probability

    Yan S, Kwan YH, Tan CS, Thumboo J, Low LL. A systematic review of the clinical application of data-driven population segmentation analysis. BMC Medical Research Methodology. 2018;18(1):121. doi:10.1186/s12874-018-0584-9. Methods and Discussion: parametric methods such as latent class analysis assign an individual to a cluster with, for example, the maximum posterior probability of membership, and latent class analysis has goodness-of-fit measures to help determine the statistically optimal number of segments; latent class methods were the most common segmentation approach among the 216 included studies (96).

    View source →

Canonical Identity

Stable URI · Machine-readable · Resolvable · CC BY 4.0