Augment-and-Conquer Negative Binomial Processes
Mingyuan Zhou, Lawrence Carin
Introduction
There has been increasing interest in count modeling using the Poisson process, geometric process and recently the negative binomial (NB) process . Notably, it has been independently shown in and that the NB process, originally constructed for count analysis, can be naturally applied for mixture modeling of grouped data , where each group . For a territory long occupied by the hierarchical Dirichlet process (HDP) and related models, the inference of which may require substantial bookkeeping and suffer from slow convergence , the discovery of the NB process for mixture modeling can be significant. As the seemingly distinct problems of count and mixture modeling are united under the NB process framework, new opportunities emerge for better data fitting, more efficient inference and more flexible model constructions. However, neither nor explore the properties of the NB distribution deep enough to achieve fully tractable closed-form inference. Of particular concern is the NB dispersion parameter, which was simply fixed or empirically set , or inferred with a Metropolis-Hastings algorithm . Under these limitations, both papers fail to reveal the connections of the NB process to the HDP, and thus may lead to false assessments on comparing their modeling abilities.
We perform joint count and mixture modeling under the NB process framework, using completely random measures that are simple to construct and amenable for posterior computation. We propose to augment-and-conquer the NB process: by “augmenting” a NB process into both the gamma-Poisson and compound Poisson representations, we “conquer” the unification of count and mixture modeling, the analysis of fundamental model properties, and the derivation of efficient Gibbs sampling inference. We make two additional contributions: 1) we construct a gamma-NB process, analyze its properties and show how its normalization leads to the HDP, highlighting its unique theoretical, structural and computational advantages relative to the HDP. 2) We show that a variety of NB processes can be constructed with distinct model properties, for which the shared random measure can be selected from completely random measures such as the gamma, beta, and beta-Bernoulli processes; we compare their performance on topic modeling, a typical example for mixture modeling of grouped data, and show the importance of inferring both the NB dispersion and probability parameters, which respectively govern the overdispersion level and the variance-to-mean ratio in count modeling.
Before introducing the NB process, we first illustrate how the seemingly distinct problems of count and mixture modeling can be united under the Poisson process. Denote as a measure space and for each Borel set , denote as a count random variable describing the number of observations in that reside within . Given grouped data , for any measurable disjoint partition of , we aim to jointly model the count random variables . A natural choice would be to define a Poisson process , with a shared completely random measure on , such that X_{j}(A)\sim\mbox{Pois}\big{(}G(A)\big{)} for each . Denote and . Following Lemma 4.1 of , the joint distributions of are equivalent under the following two expressions:
Thus the Poisson process provides not only a way to generate independent counts from each , but also a mechanism for mixture modeling, which allocates the observations into any measurable disjoint partition of , conditioning on and the normalized mean measure .
To complete the model, we may place a gamma process prior on the shared measure as , with concentration parameter and base measure , such that for each , where can be continuous, discrete or a combination of both. Note that now becomes a Dirichlet process (DP) as , where and . The normalized gamma representation of the DP is discussed in and has been used to construct the group-level DPs for an HDP . The Poisson processhas an equal-dispersion assumption for count modeling. As shown in (2), the construction of Poisson processes with a shared gamma process mean measure implies the same mixture proportions across groups, which is essentially the same as the DP when used for mixture modeling when the total counts are not treated as random variables. This motivates us to consider adding an additional layer or using a different distribution other than the Poisson to model the counts. As shown below, the NB distribution is an ideal candidate, not only because it allows overdispersion, but also because it can be augmented into both a gamma-Poisson and a compound Poisson representations.
Augment-and-Conquer the Negative Binomial Distribution
The NB distribution has the probability mass function (PMF) . It has a mean smaller than the variance , with the variance-to-mean ratio (VMR) as and the overdispersion level (ODL, the coefficient of the quadratic term in ) as . It has been widely investigated and applied to numerous scientific studies . The NB distribution can be augmented into a gamma-Poisson construction as , where the gamma distribution is parameterized by its shape and scale . It can also be augmented under a compound Poisson representation as , where is the logarithmic distribution with probability-generating function (PGF) In a slight abuse of notation, but for added conciseness, in the following discussion we use to denote .
The inference of the NB dispersion parameter has long been a challenge . In this paper, we first place a gamma prior on it as . We then use Lemma 2.1 (below) to infer a latent count for each conditioning on and . Since by construction, we can use the gamma Poisson conjugacy to update . Using Lemma 2.2 (below), we can further infer an augmented latent count for each , and then use these latent counts to update , assuming . Using Lemmas 2.1 and 2.2, we can continue this process repeatedly, suggesting that we may build a NB process to model data that have subgroups within groups. The conditional posterior of the latent count was first derived by us but was not given an analytical form . Below we explicitly derive the PMF of , shown in (3), and find that it exactly represents the distribution of the random number of tables occupied by customers in a Chinese restaurant process with concentration parameter . We denote as a Chinese restaurant table (CRT) count random variable with such a PMF and as proved in the supplementary material, we can sample it as .
Both the gamma-Poisson and compound-Poisson augmentations of the NB distribution and Lemmas 2.1 and 2.2 are key ingredients of this paper. We will show that these augment-and-concur methods not only unite count and mixture modeling and provide efficient inference, but also, as shown in Section 3, let us examine the posteriors to understand fundamental properties of the NB processes, clearly revealing connections to previous nonparametric Bayesian mixture models.
Denote as Stirling numbers of the first kind . Augment under the compound Poisson representation as , then the conditional posterior of has PMF
Denote , . Since is the summation of iid random variables, the PGF of becomes . Using the property that , we have Thus for , we have Denote , we have . ∎
Let , denote , then can also be generated from a compound distribution as
Augmenting leads to . Marginalizing out leads to . Augmenting using its compound Poisson representation leads to (4). ∎
Gamma-Negative Binomial Process
We explore sharing the NB dispersion across groups while the probability parameters are group dependent. We define a NB process as for each and construct a gamma-NB process for joint count and mixture modeling as , which can be augmented as a gamma-gamma-Poisson process as
In the above PP() and GaP() represent the Poisson and gamma processes, respectively, as defined in Section 1.1. Using Lemma 2.2, the gamma-NB process can also be augmented as
These three augmentations allow us to derive a sequence of closed-form update equations for inference with the gamma-NB process. Using the gamma Poisson conjugacy on (5), for each , we have , thus the conditional posterior of is
Define as a CRT process that for each . Applying Lemma 2.1 on (6) and (7), we have
If is a continuous base measure and is finite, we have and thus
which is equal to , the total number of used discrete atoms; if is discrete as , then if , thus . In either case, let , with the gamma Poisson conjugacy on (6) and (7), we have
Since the data are exchangeable within group , the predictive distribution of a point , conditioning on and , with marginalized out, can be expressed as
Using the equivalence between (1) and (2) and normalizing all the gamma processes in (5), denoting , , , and , we can re-express (5) as
which is an HDP . Thus the normalized gamma-NB process leads to an HDP, yet we cannot return from the HDP to the gamma-NB process without modeling and as random variables. Theoretically, they are distinct in that the gamma-NB process is a completely random measure, assigning independent random variables into any disjoint Borel sets of ; whereas the HDP is not. Practically, the gamma-NB process can exploit conjugacy to achieve analytical conditional posteriors for all latent parameters. The inference of the HDP is a major challenge and it is usually solved through alternative constructions such as the Chinese restaurant franchise (CRF) and stick-breaking representations . In particular, without analytical conditional posteriors, the inference of concentration parameters and is nontrivial and they are often simply fixed . Under the CRF metaphor governs the random number of tables occupied by customers in each restaurant independently; further, if the base probability measure is continuous, governs the random number of dishes selected by tables of all restaurants. One may apply the data augmentation method of to sample and .However, if is discrete as , which is of practical value and becomes a continuous base measure as , then using the method of to sample is only approximately correct, which may result in a biased estimate in practice, especially if is not large enough. By contrast, in the gamma-NB process, the shared gamma process can be analytically updated with (12) and plays the role of in the HDP, which is readily available as
and as in (11), regardless of whether the base measure is continuous, the total mass has an analytical gamma posterior whose shape parameter is governed by , with if is continuous and finite and if . Equation (15) also intuitively shows how the NB probability parameters govern the variations among in the gamma-NB process. In the HDP, is not explicitly modeled, and since its value becomes irrelevant when taking the normalized constructions in (14), it is usually treated as a nuisance parameter and perceived as when needed for interpretation purpose. Fixing is also considered in to construct an HDP, whose group-level DPs are normalized from gamma processes with the scale parameters as ; it is also shown in that improved performance can be obtained for topic modeling by learning the scale parameters with a log Gaussian process prior. However, no analytical conditional posteriors are provided and Gibbs sampling is not considered as a viable option .
2 Augment-and-conquer inference for joint count and mixture modeling
where marginally we have . Using the equivalence between (1) and (2), we can equivalently express and in the above model as , where . Since the data are fully exchangeable, rather than drawing once, we may equivalently draw the index
for each and then let . This provides further insights on how the seemingly disjoint problems of count and mixture modeling are united under the NB process framework. Following (8)-(12), the block Gibbs sampling is straightforward to write as
which has similar computational complexity as that of the direct assignment block Gibbs sampling of the CRF-HDP . If is conjugate to the likelihood , then the posterior would be analytical. Note that when , we have .
Using (1) and (2) and normalizing the gamma distributions, (16) can be re-expressed as
which loses the count modeling ability and becomes a finite representation of the HDP, the inference of which is not conjugate and has to be solved under alternative representations . This also implies that by using the Dirichlet process as the foundation, traditional mixture modeling may discard useful count information from the beginning.
The Negative Binomial Process Family and Related Algorithms
The gamma-NB process shares the NB dispersion across groups. Since the NB distribution has two adjustable parameters, we may explore alternative ideas, with the NB probability measure shared across groups as in , or with both the dispersion and probability measures shared as in . These constructions are distinct from both the gamma-NB process and HDP in that has space dependent scales, and thus its normalization no longer follows a Dirichlet process.
It is natural to let the probability measure be drawn from a beta process , which can be defined by its Lévy measure on a product space as A draw from the beta process with concentration parameter and base measure can be expressed as A beta-NB process can be constructed by letting , with a random draw expressed as Under this construction, the NB probability measure is shared and the NB dispersion parameters are group dependent. As in , we may also consider a marked-beta-NBWe may also consider a beta marked-gamma-NB process, whose performance is found to be very similar. process that both the NB probability and dispersion measures are shared, in which each point of the beta process is marked with an independent gamma random variable. Thus a draw from the marked-beta process becomes , and the NB process becomes Since the beta and NB processes are conjugate, the posterior of is tractable, as shown in . If it is believed that there are excessive number of zeros, governed by a process other than the NB process, we may introduce a zero inflated NB process as , where is drawn from the Bernoulli process and is drawn from a marked-beta process, thus . This construction can be linked to the model in with appropriate normalization, with advantages that there is no need to fix and the inference is fully tractable. The zero inflated construction can also be linked to models for real valued data using the Indian buffet process (IBP) or beta-Bernoulli process spike-and-slab prior .
To show how the NB processes can be diversely constructed and to make connections to previous parametric and nonparametric mixture models, we show in Table 1 a variety of NB processes, which differ on how the dispersion and probability measures are shared. For a deeper understanding on how the counts are modeled, we also show in Table 1 both the VMR and ODL implied by these settings. We consider topic modeling of a document corpus, a typical example of mixture modeling of grouped data, where each a-bag-of-words document constitutes a group, each word is an exchangeable group member, and is simply the probability of word in topic .
We consider six differently constructed NB processes in Table 1: (i) Related to latent Dirichlet allocation (LDA) and Dirichlet Poisson factor analysis (Dir-PFA) , the NB-LDA is also a parametric topic model that requires tuning the number of topics. However, it uses a document dependent and to automatically learn the smoothing of the gamma distributed topic weights, and it lets to share statistical strength between documents, with closed-form Gibbs sampling inference. Thus even the most basic parametric LDA topic model can be improved under the NB count modeling framework. (ii) The NB-HDP model is related to the HDP , and since is an irrelevant parameter in the HDP due to normalization, we set it in the NB-HDP as 0.5, the usually perceived value before normalization. The NB-HDP model is comparable to the DILN-HDP that constructs the group-level DPs with normalized gamma processes, whose scale parameters are also set as one. (iii) The NB-FTM model introduces an additionalbeta-Bernoulli process under the NB process framework to explicitly model zero counts. It is the same as the sparse-gamma-gamma-PFA (S-PFA) in and is comparable to the focused topic model (FTM) , which is constructed from the IBP compound DP. Nevertheless, they apply about the same likelihoods and priors for inference. The Zero-Inflated-NB process improves over them by allowing to be inferred, which generally yields better data fitting. (iv) The Gamma-NB process explores the idea that the dispersion measure is shared across groups, and it improves over the NB-HDP by allowing the learning of . It reduces to the HDP by normalizing both the group-level and the shared gamma processes. (v) The Beta-NB process explores sharing the probability measure across groups, and it improves over the beta negative binomial process (BNBP) proposed in , allowing inference of . (vi) The Marked-Beta-NB process is comparable to the BNBP proposed in , with the distinction that it allows analytical update of . The constructions and inference of various NB processes and related algorithms in Table 1 all follow the formulas in (16) and (3.2), respectively, with additional details presented in the supplementary material.
Example Results
Figure 1 compares the performance of various algorithms. The Marked-Beta-NB process has the best performance, closely followed by the Gamma-NB process, CRF-HDP and Beta-NB process. With an appropriate , the parametric NB-LDA may outperform the nonparametric NB-HDP and NB-FTM as the training data percentage increases, somewhat unexpected but very intuitive results, showing that even by learning both the NB dispersion and probability parameters and in a document dependent manner, we may get better data fitting than using nonparametric models that share the NB dispersion parameters across documents, but fix the NB probability parameters.
It is also interesting to compare the Gamma-NB and NB-HDP. From a mixture-modeling viewpoint, fixing is natural as becomes irrelevant after normalization. However, from a count modeling viewpoint, this would make a restrictive assumption that each count vector has the same VMR of 2, and the experimental results in Figure 1 confirm the importance of learning together with . It is also interesting to examine (15), which can be viewed as the concentration parameter in the HDP, allowing the adjustment of would allow a more flexible model assumption on the amount of variations between the topic proportions, and thus potentially better data fitting.
Conclusions
We propose a variety of negative binomial (NB) processes to jointly model counts across groups, which can be naturally applied for mixture modeling of grouped data. The proposed NB processes are completely random measures that they assign independent random variables to disjoint Borel sets of the measure space, as opposed to the hierarchical Dirichlet process (HDP) whose measures on disjoint Borel sets are negatively correlated. We discover augment-and-conquer inference methods that by “augmenting” a NB process into both the gamma-Poisson and compound Poisson representations, we are able to “conquer” the unification of count and mixture modeling, the analysis of fundamental model properties and the derivation of efficient Gibbs sampling inference. We demonstrate that the gamma-NB process, which shares the NB dispersion measure across groups, can be normalized to produce the HDP and we show in detail its theoretical, structural and computational advantages over the HDP. We examine the distinct sharing mechanisms and model properties of various NB processes, with connections to existing algorithms, with experimental results on topic modeling showing the importance of modeling both the NB dispersion and probability parameters.
The research reported here was supported by ARO, DOE, NGA, and ONR, and by DARPA under the MSEE and HIST programs.
References
Appendix A Generating a CRT random variable
A CRT random variable can be generated with the summation of independent Bernoulli random variables as
Since is the summation of independent Bernoulli random variables, its PGF becomes
Thus we have ∎
Appendix B Dir-PFA and LDA
The Dirichlet Poisson factor analysis (Dir-PFA) model is constructed as
where is the Dirichlet smoothing parameter for the topic’s distribution over the vocabulary, , and the data likelihood in topic modeling is , the probability of the th word in th document under topic .
The Dir-PFA has the same block Gibbs sampling as LDA , expressed as
Appendix C CRF-HDP
Under the CRF metaphor, denote as the number of customers eating dish in restaurant and as the number of tables serving dish in restaurant , the direct assignment block Gibbs sampling can be expressed as
When , the concentration parameter can be sampled as
where is the number of used atoms. Since it is infeasible in practice to let , directly using this method to sample is only approximately correct, which may result in a biased estimate especially if is not set large enough. Thus in the experiments, is not sampled and is fixed as one. Note that for implementation convenience, it is also common to fix the concentration parameter as one . We find through experiments that learning this parameter usually results in obviously lower per-word perplexity for held out words, thus we allow the learning of using the data augmentation method proposed in , which is modified from the one proposed in .
Appendix D NB-LDA
Note that letting allows different documents to share statistical strength for inferring their NB dispersion parameters.
The block Gibbs sampling can be expressed as
Appendix E NB-HDP
The NB-HDP model is a special case of the Gamma-NB process model with . The hierarchical model and inference for the Gamma-NB process are shown in (16) and (18) of the main paper, respectively.
Appendix F NB-FTM
The NB-FTM model is a special case of zero-inflated NB process with , which is constructed as
The block Gibbs sampling can be expressed as
Appendix G Beta-NB
The beta-NB process model is constructed as
The block Gibbs sampling can be expressed as
Appendix H Marked-Beta-NB
The Marked-Beta-NB process model is constructed as
The block Gibbs sampling can be expressed as
Appendix I Marked-Gamma-NB
The Marked-Gamma-NB process model is constructed as
The block Gibbs sampling can be expressed as