For an MCMC draw from a DPMM D_x, let Z_x be the vector of Z-scores of the observations based on that observation's current group, and let A_x be the 0,1 adjacency matrix where $$[A_x]_{ij} = 1$$ if observations i and j are in the same group in draw D_x (so the diagonal is always 1s). Then we define the DPMM distance between D_x and D_y as: $$ d(D_x, D_y) = |Z_x - Z_y|^T(|A_x - A_y| + I)|Z_x - Z_y|. $$
dpmmDistance(x, y)
Numeric, DPMM distance between x and y.
List with elements 'Zscore' and 'Adj'
List with elements 'Zscore' and 'Adj', both of same dimensions as in x.