De Blasi 2015 - Mixture Models and the Prior on the Number of Clusters

Summary

In a hierarchical mixture the EPPF is the prior on partitions, hence on . The DP gives a sharply peaked prior on ; PY and NGG with give flat priors with the same mean, and when the prior mean (25) is far from the truth (2 components) they shift the posterior far more (Table 1).

Main Content

Random density (Eq. 26). Posterior on the number of components: - the sum over all partitions of into clusters.

Prior distribution of (Eq. 27)

a generalised factorial coefficient. For the DP (): with the Stirling number of the first kind.

Role of parameters: for the DP, shifts the location of . For PY and NGG, (resp. ) controls location and controls the flatness: larger flattens the prior (Fig. 1, NGG with , , ).

Prior elicitation comparison (Fig. 2). , all five priors tuned so that :

PriorParameters
DP
PY
PY
NGG
NGG

The DP prior on is sharply peaked; larger gives larger variability.

Toy example (Fig. 3, Table 1). draws from an equal mixture of and (two clear groups). Model: , , , hyperpriors , . Marginal MCMC with acceleration step, 100,000 iterations after 5,000 burn-in. Posterior of (selected rows; all figures from Table 1):

DP(19.233)NGG(0.25,48.4185)PY(0.25,12.216)NGG(0.7353,1)PY(0.73001,1)
20.00110.00390.01320.21430.4630
30.00680.02090.04870.28540.3015
40.02200.05140.09790.22630.1399
50.04840.08940.14190.13600.0573
60.07890.12290.15280.07130.0225
70.10690.14120.15060.03610.0092
80.12570.13680.12450.01630.0037
90.13010.11870.09210.00790.0016
100.12050.09760.06590.00350.0007
110.10310.07460.04350.00170.0003
120.08160.05160.02830.00070.0002
130.05970.03530.01700.00030.0001
0.11510.05560.02370.00040.0001

( has probability 0.0000 in every column.) Interpretation: with a wrong prior guess of 25 clusters, the DP stays stuck around 10 components; PY(0.73) puts 0.463 mass on the true and 0.30 on 3. A stronger reinforcement (larger ) allows data to overrule a bad prior on . Density estimates (Fig. 4) differ much less than the number of clusters; PY and NGG with adhere slightly more closely to the true density. These are structural properties of the models (see also Lijoi, Mena, Prunster 2007).

Examples

Reproduce the prior on (flatter with larger )

A dynamic programme over the PY urn gives the exact prior; all three parameter settings have mean 25.000, with standard deviations 3.26 (DP), 3.79 (PY 0.25) and 8.05 (PY 0.73), and the PY(0.73) mode at 27.

import numpy as np
def prior_K(n, sigma, theta):
    p = np.zeros(n + 1); p[1] = 1.0
    for m in range(1, n):
        new = np.zeros(n + 1)
        for k in range(1, m + 1):
            q = (theta + sigma * k) / (theta + m)       # P(new cluster | m items, k clusters)
            new[k + 1] += p[k] * q; new[k] += p[k] * (1 - q)
        p = new
    return p
k = np.arange(51)
for s, t in [(0, 19.233), (0.25, 12.2157), (0.73001, 1)]:
    p = prior_K(50, s, t); mu = (p * k).sum()
    print(s, t, round(mu, 3), round(float((p * (k - mu) ** 2).sum() ** 0.5), 2), int(p.argmax()))

Relevance to marketing measurement

When you cluster customers or geos with a DP mixture, the prior on the number of segments is not neutral: set it by simulation (this note), and consider PY/NGG for a flatter prior on . Report sensitivity of and of cluster-based conclusions.

Connections

Teh 2010 - DP Mixture Models and Applications, Monsters and Mixtures, Concept - Label Switching and Label-Invariant Summaries.

See Also

De Blasi 2015 - Gibbs-Type Priors - Overview