The combinatorial structure of beta negative binomial processes
Creighton Heaukulani, Daniel M. Roy
Introduction
Let , let be a non-atomic, finite measure on , and let be a Poisson (point) process on with intensity
As this intensity is non-atomic and merely -finite, will have an infinite number of atoms almost surely (a.s.), and so we may write for some a.s. unique random elements in and in . From , construct the random measure
which is a beta process . The construction of ensures that the random variables are independent for every finite, disjoint collection , and is said to be completely random or equivalently, have independent increments . We review completely random measures in Section 2.
The conjugacy of the family of beta distributions with various other exponential families carries over to beta processes and randomizations by probability kernels lying in these same exponential families. The beta process is therefore a convenient choice for further randomizations, or in the language of Bayesian nonparametrics, as a prior stochastic process. For example, previous work has focused on the (simple) point process that takes each atom with probability for every , which is, conditioned on , called a Bernoulli process (with base measure ) . In this article, we study the point process
where the random variables are conditionally independent given and
for some parameter . Here, denotes the negative binomial distribution with parameters , , whose probability mass function (p.m.f.) is
where with is the th rising factorial. Note that, conditioned on , the point process is the (fixed component) of a negative binomial process . Unconditionally, is the ordinary component of a beta negative binomial process, which we formally define in Section 2.
Existing constructions for beta negative binomial processes truncate the number of atoms in the underlying beta process and typically use slice sampling to remove the error introduced by this approximation asymptotically . In this work, we instead provide a construction for the beta negative binomial process directly, avoiding a representation of the underlying beta process. To this end, note that while the beta process has a countably infinite number of atoms a.s., it can be shown that is still an a.s. finite measure . It follows as an easy consequence that the point process is a.s. finite as well and, therefore, has an a.s. finite number of atoms, which we represent with a Poisson process. The atomic masses are then characterized by the digamma distribution, introduced by Sibuya , which has p.m.f. (for parameters ) given by
where denotes the digamma function. In Section 3, we prove the following:
Let be a Poisson process on with finite intensity
where is the beta negative binomial process defined in equation (4).
The probability mass function of is
where , for every , and .
selects distinct dishes, taking servings of each dish, independently.
selects new dishes to taste, taking servings of each dish, independently.
The interpretation here is that, for every , the count is the number of dishes such that, for every , customer took servings of dish . Then the sum in equation (10) is the total number of servings taken of dish by the first customers. Because the NB-IBP is the combinatorial structure of a conditionally i.i.d. process, its distribution, given in Theorem 2, must be invariant to every permutation of the customers. We can state this property formally as follows.
Let be a permutation of , and, for , note that the composition is given by , for every . Then
Preliminaries
Here, we review completely random measures and formally define the negative binomial and beta negative binomial processes. We provide characterizations via Laplace functionals and conclude the section with a discussion of related work.
Let denote the space of -finite measures on equipped with the -algebra generated by the projection maps for all . A random measure on is a random element in , and we say that is completely random or has independent increments when, for every finite collection of disjoint, measurable sets , the random variables are independent. Here, we briefly review completely random measures; for a thorough treatment, the reader should consult Kallenberg , Chapter 12, or the classic text by Kingman . Every completely random measure can be written as a sum of three independent parts
called the diffuse, fixed, and ordinary components, respectively, where:
is a non-random, non-atomic measure;
In this article, we will only study purely-atomic completely random measures, which therefore have no diffuse component. It follows that we may characterize the law of by (1) the distributions of the atomic masses in the fixed component, and (2) the intensity of the Poisson process underlying the ordinary component.
2 Definitions
By a base measure on , we mean a -finite measure on such that for all . For the remainder of the article, fix a base measure . We may write
and an ordinary component with intensity measure
It is straightforward to show that a beta process is itself a base measure with probability one. This definition of the beta process generalizes the version given in the introduction to a non-homogeneous process with a fixed component. Likewise, we generalize our earlier definition of a negative binomial process to include an ordinary component.
and an ordinary component with intensity measure
The fixed component in this definition was given by Broderick et al. and Zhou et al. (and by Thibaux for the case ). Here, we have additionally defined an ordinary component, following intuitions from Roy .
The law of a random measure is completely characterized by its Laplace functional, and this representation is often simpler to manipulate: From Campbell’s theorem, or a version of the Lévy–Khinchin formula for Borel spaces, one can show that the Laplace functional of is
Finally, we define beta negative binomial processes via their conditional law.
A random measure on is a beta negative binomial process with parameter , concentration function , and base measure , written
This characterization was given by Broderick et al. and can be seen to match a special case of the model in Zhou et al. (see the discussion of related work in Section 2.3). It is straightforward to show that a beta negative binomial process is also completely random, and that its Laplace functional is given by
3 Related work
The term “negative binomial process” has historically been reserved for processes with negative binomial increments – a class into which the process we study here does not fal – and these processes have been long-studied in probability and statistics. We direct the reader to Kozubowski and Podgórski for references.
One way to construct a process with negative binomial increments is to rely upon the fact that a negative binomial distribution is a gamma mixture of Poisson distributions. In particular, similarly to the construction by Lo , consider a Cox process directed by a gamma process with finite non-atomic intensity. So constructed, has independent increments with negative binomial distributions. Like the beta process (with a finite intensity underlying its ordinary component), the gamma process has, with probability one, a countably infinite number of atoms but a finite total mass, and so the Cox process is a.s. finite as well. Despite similarities, a comparison of Laplace functionals shows that the law of is not that of a beta negative binomial process. Using an approach directly analogous to the derivation of the IBP in , Titsias characterizes the combinatorial structure of a sequence of point processes that, conditioned on , are independent and identically distributed to the Cox process . See Section 4 for comments. This was the first count analogue of the IBP; the possibility of a count analogue arising from beta negative binomial processes was first raised by Zhou et al. , who described the distribution of the number of new dishes sampled by each customer. Recent work by Zhou, Madrid and Scott , independent of our own and proceeding along different lines, describes a combinatorial process related to the NB-IBP (following a re-scaling of the beta process intensity).
Finally, we note that another negative binomial process without negative binomial increments was defined on Euclidean space by Barndorff-Nielsen and Yeo and extended to general spaces by Grégoire and Wolpert and Ickstadt . These measures are generally Cox processes on directed by random measures of the form
Constructing beta negative binomial processes
Before providing a finitary construction for the beta negative binomial process, we make a few remarks on the digamma distribution. For the remainder of the article, define for some . Following a representation by Sibuya , we may relate the digamma and beta negative binomial distributions as follows: Let and define , the latter of which has p.m.f.
With digamma random variables, we provide a finitary construction for the beta negative binomial process. The following result generalizes the statement given by Theorem 1 (in the Introduction) to a non-homogeneous process, which also has a fixed component.
Let , and let be a collection of independent random variables with
Let be a Poisson process on , independent from , with (finite) intensity
Then by the chain rule of conditional expectation, complete randomness, and Campbell’s theorem,
which is the desired form of the Laplace functional. ∎
where and , for .
We may therefore construct this exchangeable sequence of beta negative binomial processes with Theorem 4.
Combinatorial structure
Let , and define to be the collection of histories in that agree with on the first entries. Then note that
that is, the multiplicities at stage completely determine the multiplicities at all earlier stages. It follows that
where for . The structure of equation (LABEL:eqJointCombStruct) suggests an inductive proof for Theorem 2.
a Poisson random variable with mean , where ;
an i.i.d. collection of a.s. unique random elements in ;
and a.s. Therefore,
Because are i.i.d., the collection has a multinomial distribution conditioned on its sum . Namely, counts the number of times, in independent trials, that the multiplicity arises from a distribution. In particular,
𝑛1h\in\mathcal{H}_{n+1} Let . Recall that for . We may write
a Poisson random variable with mean ;
an i.i.d. collection of a.s. unique random elements in , a.s. distinct also from ;
all mutually independent and independent of , such that
Conditioned on , the first and second terms on the right-hand side correspond to the fixed and ordinary components of , respectively. Let
be the set of histories for which is the first non-zero element. Then, with probability one,
By the stated independence of the variables above, we have
Let . For every , the random variables are i.i.d., and therefore, conditioned on , the collection has a multinomial distribution. In particular, the product term in equation (45) is given by
The p.m.f. of the beta negative binomial distribution is given by
for positive parameters , and , where denotes the beta function. We have that a.s., and therefore
Because are i.i.d., conditioned on the sum , the collection has a multinomial distribution, and so
In the first product term on the right-hand side of equation (50), note that, for every ,
where for the last equality, we have used the fact that for every and . Note that . Then equation (50) is equal to
Noting that , we obtain the expression in equation (10) for , as desired.
Applications in Bayesian nonparametrics
In Bayesian latent feature models, we assume that there exists a latent set of features and that each data point possesses some (finite) subset of the features. The features then determine the distribution of the observed data. In a nonparametric setting, exchangeable sequences of simple point processes can serve as models for the latent sets of features. Similarly, exchangeable sequences of point processes, like those that can be constructed from beta negative binomial processes, can serve as models of latent multisets of features. In particular, atoms are features and their (integer-valued) masses indicate multiplicity. In this section, we develop posterior inference procedures for exchangeable sequences of beta negative binomial processes.
A convenient way to represent the combinatorial structure of an exchangeable sequence of point processes is via an array/matrix of non-negative integers, where the rows correspond to point processes and columns correspond to atoms appearing among the point processes. Informally, given an enumeration of the set of all atoms appearing in , the entry associated with the th row and th column is the multiplicity/mass of the atom labeled in the th point process .
All that remains is to order the columns of . Every total order on induces a unique ordering of the columns of . Titsias defined a unique ordering in this way, analogous to the left-ordered form defined by Griffiths and Ghahramani for the IBP. In particular, for , let denote the lexicographic order given by: if and only if or , where is the first coordinate where and differ. We say is left-ordered when its columns are ordered according to . Because there is a bijection between combinatorial structures and their unique representations by left-ordered arrays, the probability mass function of is given by equation (10).
Other orderings have been introduced in the literature: If we permute the columns of uniformly at random, then is the analogue of the uniform random labeling scheme described by Broderick, Pitman and Jordan for the IBP. Note that the number of distinct ways of ordering the columns is given by the multinomial coefficient
where the denominator arises from the fact that there are indistinguishable columns for every history . The following result is then immediate:
An array representation makes it easy to visualize some properties of the model. For example, in Figure 1 we display several simulations from the NB-IBP with varying values of the parameters , and . The columns are displayed in the order of first appearance, and are otherwise ordered uniformly at random. (A similar ordering was used by Griffiths and Ghahramani to introduce the IBP.) The relationship of the model to the values of and are similar to the characteristics described by Ghahramani, Griffiths and Sollich for the IBP, with the parameter providing flexibility with respect to the counts in the array. In particular, the total number of features, , is Poisson distributed with mean , which increases with , , and . From the NB-IBP, we know that the expected number of features for the first (and therefore, by exchangeability, every) row is . Because of the ordering we have chosen here, the rows are not exchangeable, despite the sequence being exchangeable. (In contrast, a uniform random labeling is row exchangeable and, conditioned on , column exchangeable.) Finally, note that the mean of the distribution exists for and is given by
which increases with and decreases with . This is the expected multiplicity of each feature for the first row, which again, by exchangeability, must hold for every row. We may therefore summarize the effects of changing each of these parameters (as we hold the others constant) as follows:
Increasing the mass parameter increases both the expected total number of features and the expected number of features per row, while leaving the expected multiplicities of the features unchanged.
Increasing the concentration parameter increases the expected total number of features and decreases the expected multiplicites of the features, while leaving the expected number of features per row unchanged.
Increasing the parameter increases both the expected total number of features and the expected multiplicities of the features, while leaving the expected number of features per row unchanged.
These effects can be seen in the first, second, and third rows of Figure 1, respectively. We note that has a weak effect on the expected total number of features (seen in the third row of Figure 1), and has a weak effect on the expected multiplicities of the features (seen in the second row of Figure 1). The model may therefore be effectively tuned with and determining the size and density of the array, and determining the multiplicities. The most appropriate model depends on the application at hand, and in Section 5.3 we discuss how these parameters may be inferred from data.
2 Examples
Latent feature models with associated multiplicities and unbounded numbers of features have found several applications in Bayesian nonparametric statistics, and we now provide some examples. In these applications, the features represent latent objects or factors underlying a dataset comprised of groups of measurements , where each group is comprised of measurements . In particular, denotes the number of instances of object/factor in group .
These nonparametric latent feature representations lend themselves naturally to mixture models with an unbounded number of components. For example, consider a variant of the models by Sudderth et al. and Titsias for a dataset of street camera images where the latent features are interpreted as object classes that may appear in the images, such as “building”, “car”, “road”, etc. The count models the relative number of times object class appears in image . For every , image consists of local patches detected in the image, which are (collections of) continuous variables representing, for example, color, hue, location in the image, etc. Let be the number of columns of , that is, the number of features. The local patches in image are modeled as conditionally i.i.d. draws from a mixture of Gaussian distributions, where of these components are associated with feature . For let denote the mean and covariance of the Gaussian components associated with feature for image . Let when is assigned to component associated with feature . Conditioned on and the assignments , the distribution of the measurements admits a conditional density
To share statistical strength across images, the parameters are given a hierarchical Bayesian prior:
A typical choice for is the family of Gaussian–inverse-Wishart distributions with feature-specific parameters drawn i.i.d. from a distribution . Finally, for every image , conditioned on , the assignment variables for the local patches in image are assumed to form a multivariate Pólya urn scheme, arising from repeated draws from a Dirichlet-distributed probability vector over . The parameters for the Dirichlet distributions are tied in a similar fashion to . The interpretation here is that local patch in image is assigned to one of the instances of the latent objects appearing in the image. The number of object instances to which a patch may be assigned is specific to the image, but components across all images that correspond to the same feature will be similar.
Latent feature representations are also a natural choice for factor analysis models. Canny and Zhou et al. proposed models for text documents in terms of latent features representing topics. More carefully, let be the number of occurrences of word in document . Conditioned on and a collection of non-negative topic-word weights , the word counts are assumed to be conditionally i.i.d. and
In other words, the expected number of occurrences of word in document is a linear sum of a small number of weighted factors. The features here are interpreted as topics: words such that is large are likely to appear many times. There are a total of topics that are shared across the documents. The topic-word weights are typically chosen to be i.i.d. Gamma random variates, although there may be reason to prefer priors with dependency enforcing further sparsity. This general setup has been applied to other types of data including, for example, recommendations , where represents the rating a Netflix user assigns to a film .
3 Conditional distributions
Let be a uniform random labelling of a NB-IBP as described in Section 5.1. In the applications described above, computing the posterior distribution of is the first step towards most other inferential goals. Existing inference schemes use stick-breaking representations, that is, they represent (a truncation of) the beta process underlying . This approach has some advantages, including that the entries of are then conditionally independent negative binomial random variables. On the other hand, the random variables representing the truncated beta process, as well as the truncation level itself, must be marginalized away using auxiliary variable methods or other techniques . Here, we take advantage of the structure of the NB-IBP and do not represent the beta process. The result is a set of Markov (proposal) kernels analogous to those originally derived for the IBP .
The models described in Section 5.2 associate every feature with a latent parameter. Therefore, conditioned on the number of columns , let be an i.i.d. sequence drawn from some non-atomic distribution , and assume that the data admits a conditional density . We will associate the th column of with , and so the pair can be seen as an alternative representation for an exchangeable sequence of beta negative binomial processes. By Bayes’ rule, the posterior distributions admits a conditional density
where is a density for the joint distribution of . We describe two Markov kernels that leave this distribution invariant. Combined, these kernels give a Markov chain Monte Carlo (MCMC) inference procedure for the desired posterior.
The first kernel resamples individual elements , conditioned on the remaining elements of the array (collectively denoted by ), the data , and the parameters . By Bayes’ rule, and the independence of and given , we have
Recall that the array is row-exchangeable, and so, in the language of the NB-IBP, we may associate the th row with the final customer at the buffet. The count is the number of servings the customer takes of dish , which has been served times previously. When , we have
Therefore, we can simulate from the unnormalized, unbounded discrete distribution in equation (60) using equation (61) as a Metropolis–Hastings proposal, or we could use inverse transform sampling where the normalization constant is approximated by an importance sampling estimate.
Following Meeds et al. , the second kernel resamples the number, positions, and values of those singleton columns such that . Simultaneously, we propose a corresponding change to the sequence of latent parameters , preserving the relative ordering with the columns of . This corresponding change to cancels out the effect of the term appearing in the p.m.f. of the array . Let be the number of singleton columns, that is, let
which we note may be equal to zero. Because we are treating the customer associated with row as the final customer at the buffet, may be interpreted as the number of new dishes sampled by the final customer, in which case, we know that
We therefore propose a new array by removing the singleton columns from the array and insert new singleton columns at positions drawn uniformly at random, where is sampled from the (marginal) distribution of given in equation (63). Like those columns that were removed, each new column has exactly one non-zero entry in the th row: We draw each non-zero entry independently and identically from a distribution, which matches the distribution of the number of servings the last customer takes of each newly sampled dish.
Finally, we form a new sequence of latent parameters by removing those entries from associated with the columns that were removed from and inserting new entries, drawn i.i.d. from , at the same locations corresponding to the newly introduced columns. Let , and note that there were possible ways to insert the new columns. Therefore, the proposal density is
With manipulations similar to those in the proof of Theorem 2, it is straightforward to show that a Metropolis–Hastings kernel accepts a proposal with probability , where
Combined with appropriate Metropolis–Hastings moves that shuffle the columns of and resample the latent parameters , we obtain a Markov chain whose stationary distribution is the conditional distribution of and given the data .
Another benefit of the characterization of the distribution of in (6) is that numerically integrating over the real-valued concentration, mass, and negative binomial parameters , , and , respectively, are straightforward with techniques such as slice sampling . In the particular case when is given a gamma prior distribution, say for some positive parameters and , the conditional distribution again falls into the class of gamma distributions. In particular, the conditional density is
Acknowledgements
We thank Mingyuan Zhou for helpful feedback and for pointing out the relation of our work to that of Sibuya . We also thank Yarin Gal and anonymous reviewers for feedback on drafts. This research was carried out while C. Heaukulani was supported by the Stephen Thomas studentship at Queens’ College, Cambridge, with funding also from the Cambridge Trusts, and while D.M. Roy was a research fellow of Emmanuel College, Cambridge, with funding also from a Newton International Fellowship through the Royal Society.