{'fraction_non_alphanumeric': 0.02072829131652661, 'fraction_numerical': 0.002240896358543417, 'mean_word_length': 5.333333333333333, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
An improved merge-split sampler for conjugate dirichlet process mixture models

The Gibbs sampler is the standard Markov chain Monte Carlo sampler for drawing samples from the posterior distribution of conjugate Dirichlet process mixture models. Researchers have noticed the Gibbs sampler’s tendency to get stuck in local modes and, thus, poorly explore the posterior distribution. Jain and Neal (2004) proposed a merge-split sampler in which a naive random split is sweetened by a series of restricted Gibbs scans, where the number of Gibbs scans is a tuning parameter that must be supplied by the user. In this work, I propose an alternative merge-split sampler borrowing ideas from sequential importance sampling. My sampler proposes splits by sequentially allocating observations to one of two split components using allocation probabilities that are conditional on previously allocated data. The algorithm does not require further sweetening and is, hence, computationally efficient. In addition, no tuning parameter needs to be chosen. While the conditional allocation of observations is similar to sequential importance sampling, the output from the sampler has the correct stationary distribution due to the use of the Metropolis-Hastings ratio. The computational efficiency of my sequentially-allocated merge-split (SAMS) sampler is compared to Jain and Neal’s sampler using various values for the tuning parameter. Comparisons are made in terms of autocorrelation times for four univariate summaries of the Markov chains taken at fixed time intervals. In four examples involving different models and datasets, I show that my merge-split sampler usually performs substantially better — in some cases, two to five times faster — than existing methods, and never performs worse.