The combinatorial structure of beta negative binomial processes

Creighton Heaukulani, Daniel M. Roy

Introduction

Let c>0c>0, let B~0\widetilde{B}_{0} be a non-atomic, finite measure on Ω\Omega, and let Π\Pi be a Poisson (point) process on Ω×(0,1]\Omega\times(0,1] with intensity

As this intensity is non-atomic and merely σ\sigma-finite, Π\Pi will have an infinite number of atoms almost surely (a.s.), and so we may write Π=∑j=1∞δ(γj,bj)\Pi=\sum_{j=1}^{\infty}\delta_{(\gamma_{j},b_{j})} for some a.s. unique random elements b1,b2,…b_{1},b_{2},\ldots in (0,1](0,1] and γ1,γ2,…\gamma_{1},\gamma_{2},\ldots in Ω\Omega. From Π\Pi, construct the random measure

which is a beta process . The construction of BB ensures that the random variables B(A1),…,B(Ak)B(A_{1}),\ldots,B(A_{k}) are independent for every finite, disjoint collection A1,…,Ak∈AA_{1},\ldots,A_{k}\in\mathcal{A}, and BB 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 γj\gamma_{j} with probability bjb_{j} for every j≥1j\geq 1, which is, conditioned on BB, called a Bernoulli process (with base measure BB) . In this article, we study the point process

where the random variables ζ1,ζ2,…\zeta_{1},\zeta_{2},\ldots are conditionally independent given BB and

for some parameter r>0r>0. Here, NB⁡(r,p)\operatorname{NB}(r,p) denotes the negative binomial distribution with parameters r>0r>0, p∈(0,1]p\in(0,1], whose probability mass function (p.m.f.) is

where (a)n:=a(a+1)⋯(a+n−1)(a)_{n}:=a(a+1)\cdots(a+n-1) with (a)0:=1(a)_{0}:=1 is the nnth rising factorial. Note that, conditioned on BB, the point process XX is the (fixed component) of a negative binomial process . Unconditionally, XX 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 BB has a countably infinite number of atoms a.s., it can be shown that BB is still an a.s. finite measure . It follows as an easy consequence that the point process XX 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 r,θ>0r,\theta>0) given by

where ψ(a):=Γ′(a)/Γ(a)\psi(a):=\Gamma^{\prime}(a)/\Gamma(a) denotes the digamma function. In Section 3, we prove the following:

Let YY be a Poisson process on (Ω,A)(\Omega,\mathcal{A}) with finite intensity

where XX is the beta negative binomial process defined in equation (4).

The probability mass function of (Mh)h∈Hn(M_{h})_{h\in\mathcal{H}_{n}} is

where S(h):=∑j≤nh(j)S({h}):=\sum_{j\leq n}h(j), for every h∈Hnh\in\mathcal{H}_{n}, and T:=B~0(Ω)>0T:=\widetilde{B}_{0}(\Omega)>0.

selects Poisson⁡(cγ[ψ(c+r)−ψ(c)])\operatorname{Poisson}(c\gamma[\psi(c+r)-\psi(c)]) distinct dishes, taking digamma⁡(r,c)\operatorname{digamma}(r,c) servings of each dish, independently.

selects Poisson⁡(cγ[ψ(c+(n+1)r)−ψ(c+nr)])\operatorname{Poisson}(c\gamma[\psi(c+(n+1)r)-\psi(c+nr)]) new dishes to taste, taking digamma⁡(r,c+nr)\operatorname{digamma}(r,c+nr) servings of each dish, independently.

The interpretation here is that, for every h∈Hnh\in\mathcal{H}_{n}, the count MhM_{h} is the number of dishes kk such that, for every j≤nj\leq n, customer jj took h(j)h(j) servings of dish kk. Then the sum S(h)S({h}) in equation (10) is the total number of servings taken of dish kk by the first nn 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 π\pi be a permutation of [n]:={1,…,n}[n]:=\{1,\ldots,n\}, and, for h∈Hnh\in\mathcal{H}_{n}, note that the composition h∘π∈Hnh\circ\pi\in\mathcal{H}_{n} is given by (h∘π)(j)=h(π(j))(h\circ\pi)(j)=h(\pi(j)), for every j≤nj\leq n. 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 M(Ω,A)\mathcal{M}(\Omega,\mathcal{A}) denote the space of σ\sigma-finite measures on (Ω,A)(\Omega,\mathcal{A}) equipped with the σ\sigma-algebra generated by the projection maps μ↦μ(A)\mu\mapsto\mu(A) for all A∈AA\in\mathcal{A}. A random measure ξ\xi on (Ω,A)(\Omega,\mathcal{A}) is a random element in M(Ω,A)\mathcal{M}(\Omega,\mathcal{A}), and we say that ξ\xi is completely random or has independent increments when, for every finite collection of disjoint, measurable sets A1,…,An∈AA_{1},\ldots,A_{n}\in\mathcal{A}, the random variables ξ(A1),…,ξ(An)\xi(A_{1}),\ldots,\xi(A_{n}) 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 ξ\xi can be written as a sum of three independent parts

called the diffuse, fixed, and ordinary components, respectively, where:

ξˉ\bar{\xi} 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 ξ\xi 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 (Ω,A)(\Omega,\mathcal{A}), we mean a σ\sigma-finite measure BB on (Ω,A)(\Omega,\mathcal{A}) such that B{s}≤1B\{s\}\leq 1 for all s∈Ωs\in\Omega. For the remainder of the article, fix a base measure B0B_{0}. 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 r=1r=1). 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 XX is

Finally, we define beta negative binomial processes via their conditional law.

A random measure XX on (Ω,A)(\Omega,\mathcal{A}) is a beta negative binomial process with parameter r>0r>0, concentration function cc, and base measure B0B_{0}, 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 XX directed by a gamma process GG with finite non-atomic intensity. So constructed, XX 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 XX is a.s. finite as well. Despite similarities, a comparison of Laplace functionals shows that the law of XX 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 GG, are independent and identically distributed to the Cox process XX. 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 (Ω,A)(\Omega,\mathcal{A}) 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 λr,θ:=ψ(θ+r)−ψ(θ)\lambda_{r,\theta}:=\psi(\theta+r)-\psi(\theta) for some r,θ>0r,\theta>0. Following a representation by Sibuya , we may relate the digamma and beta negative binomial distributions as follows: Let Z∼digamma⁡(r,θ)Z\sim\operatorname{digamma}(r,\theta) and define W:=Z−1W:=Z-1, 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 r>0r>0, and let ϑ:=(ϑs)s∈A\vartheta:=(\vartheta_{s})_{s\in\mathscr{A}} be a collection of independent random variables with

Let YY be a Poisson process on (Ω,A)(\Omega,\mathcal{A}), independent from ϑ\vartheta, 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 Sn:=∑i=1nXiS_{n}:=\sum_{i=1}^{n}X_{i} and cn(s):=c(s)+Sn{s}+nrc_{n}(s):=c(s)+S_{n}\{s\}+nr, for s∈Ωs\in\Omega.

We may therefore construct this exchangeable sequence of beta negative binomial processes with Theorem 4.

Combinatorial structure

Let ℏ∈Hn\hslash\in\mathcal{H}_{n}, and define Hn+1(ℏ):={h∈Hn+1:∀j≤n,h(j)=ℏ(j)}\mathcal{H}_{n+1}^{(\hslash)}:=\{h\in\mathcal{H}_{n+1}:\forall j\leq n,h(j)=\hslash(j)\} to be the collection of histories in Hn+1\mathcal{H}_{n+1} that agree with ℏ\hslash on the first nn entries. Then note that

that is, the multiplicities (Mh)h∈Hn+1(M_{h})_{h\in\mathcal{H}_{n+1}} at stage n+1n+1 completely determine the multiplicities (Mℏ)ℏ∈Hn(M_{\hslash})_{\hslash\in\mathcal{H}_{n}} at all earlier stages. It follows that

where mℏ=∑h∈Hn+1(ℏ)mhm_{\hslash}=\sum_{h\in\mathcal{H}_{n+1}^{(\hslash)}}m_{h} for ℏ∈Hn\hslash\in\mathcal{H}_{n}. The structure of equation (LABEL:eqJointCombStruct) suggests an inductive proof for Theorem 2.

a Poisson random variable κ\kappa with mean cTλr,ccT\lambda_{r,c}, where T:=B~0(Ω)<∞T:=\widetilde{B}_{0}(\Omega)<\infty;

an i.i.d. collection of a.s. unique random elements γ1,γ2,…\gamma_{1},\gamma_{2},\ldots in Ω\Omega;

and κ=∑h∈H1Mh\kappa=\sum_{h\in\mathcal{H}_{1}}M_{h} a.s. Therefore,

Because ζ1,ζ2,…\zeta_{1},\zeta_{2},\ldots are i.i.d., the collection (Mh)h∈H1(M_{h})_{h\in\mathcal{H}_{1}} has a multinomial distribution conditioned on its sum κ\kappa. Namely, MhM_{h} counts the number of times, in κ\kappa independent trials, that the multiplicity h(1)h(1) arises from a digamma⁡(r,c)\operatorname{digamma}(r,c) distribution. In particular,

𝑛1h\in\mathcal{H}_{n+1} Let Sn:=∑j=1nXjS_{n}:=\sum_{j=1}^{n}X_{j}. Recall that s(ℏ):=∑j≤nℏ(j)s(\hslash):=\sum_{j\leq n}\hslash(j) for ℏ∈Hn\hslash\in\mathcal{H}_{n}. We may write

a Poisson random variable κ\kappa with mean cTλr,c+nrcT\lambda_{r,c+nr};

an i.i.d. collection of a.s. unique random elements γ1,γ2,…\gamma_{1},\gamma_{2},\ldots in Ω\Omega, a.s. distinct also from ω\omega;

all mutually independent and independent of X[n]X_{[n]}, such that

Conditioned on X[n]X_{[n]}, the first and second terms on the right-hand side correspond to the fixed and ordinary components of Xn+1X_{n+1}, respectively. Let

be the set of histories hh for which h(n+1)h(n+1) is the first non-zero element. Then, with probability one,

By the stated independence of the variables above, we have

Let Hn+1+:=⋃ℏ∈HnHn+1(ℏ)\mathcal{H}^{+}_{n+1}:=\bigcup_{\hslash\in\mathcal{H}_{n}}\mathcal{H}_{n+1}^{(\hslash)}. For every ℏ∈Hn\hslash\in\mathcal{H}_{n}, the random variables ϑℏ,1,ϑℏ,2,…\vartheta_{\hslash,1},\vartheta_{\hslash,2},\ldots are i.i.d., and therefore, conditioned on MℏM_{\hslash}, the collection (Mh)h∈Hn+1(ℏ)(M_{h})_{h\in\mathcal{H}_{n+1}^{(\hslash)}} 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 r,αr,\alpha, and β\beta, where B(α,β):=Γ(α)Γ(β)/Γ(α+β)\mathcal{B}(\alpha,\beta):=\Gamma(\alpha)\Gamma(\beta)/\Gamma(\alpha+\beta) denotes the beta function. We have that κ=∑h∈Hn+1(0)Mh\kappa=\sum_{h\in\mathcal{H}^{(0)}_{n+1}}M_{h} a.s., and therefore

Because ζ1,ζ2,…\zeta_{1},\zeta_{2},\ldots are i.i.d., conditioned on the sum κ\kappa, the collection (Mh)h∈Hn+1(0)(M_{h})_{h\in\mathcal{H}^{(0)}_{n+1}} has a multinomial distribution, and so

In the first product term on the right-hand side of equation (50), note that, for every h∈Hn+1+h\in\mathcal{H}^{+}_{n+1},

where for the last equality, we have used the fact that h(j)=0h(j)=0 for every j≤nj\leq n and h∈Hn+1(0)h\in\mathcal{H}^{(0)}_{n+1}. Note that ∑ℏ∈Hnmℏ+∑h∈Hn+1(0)mh=∑h∈Hn+1mh\sum_{\hslash\in\mathcal{H}_{n}}m_{\hslash}+\sum_{h\in\mathcal{H}^{(0)}_{n+1}}m_{h}=\sum_{h\in\mathcal{H}_{n+1}}m_{h}. Then equation (50) is equal to

Noting that ∑j=1n+1[ψ(c+jr)−ψ(c+(j−1)r)]=ψ(c+(n+1)r)−ψ(c)\sum_{j=1}^{n+1}[\psi(c+jr)-\psi(c+(j-1)r)]=\psi(c+(n+1)r)-\psi(c), we obtain the expression in equation (10) for n+1n+1, 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 WW 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 X[n]X_{[n]}, the entry Wi,jW_{i,j} associated with the iith row and jjth column is the multiplicity/mass of the atom labeled jj in the iith point process XiX_{i}.

All that remains is to order the columns of WW. Every total order on Hn\mathcal{H}_{n} induces a unique ordering of the columns of WW. 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 h,h′∈Hnh,h^{\prime}\in\mathcal{H}_{n}, let ⪯\preceq denote the lexicographic order given by: h⪯h′h\preceq h^{\prime} if and only if h=h′h=h^{\prime} or h(η)<h′(η)h(\eta)<h^{\prime}(\eta), where η\eta is the first coordinate where hh and h′h^{\prime} differ. We say WW is left-ordered when its columns are ordered according to ⪯\preceq. Because there is a bijection between combinatorial structures (Mh)h∈Hn(M_{h})_{h\in\mathcal{H}_{n}} and their unique representations by left-ordered arrays, the probability mass function of WW is given by equation (10).

Other orderings have been introduced in the literature: If we permute the columns of WW uniformly at random, then WW 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 κ\kappa columns is given by the multinomial coefficient

where the denominator arises from the fact that there are MhM_{h} indistinguishable columns for every history h∈Hnh\in\mathcal{H}_{n}. 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 T,cT,c, and rr. 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 TT and cc are similar to the characteristics described by Ghahramani, Griffiths and Sollich for the IBP, with the parameter rr providing flexibility with respect to the counts in the array. In particular, the total number of features, κ\kappa, is Poisson distributed with mean cT[ψ(c+nr)−ψ(c)]cT[\psi(c+nr)-\psi(c)], which increases with TT, cc, and rr. From the NB-IBP, we know that the expected number of features for the first (and therefore, by exchangeability, every) row is TT. Because of the ordering we have chosen here, the rows are not exchangeable, despite the sequence X[n]X_{[n]} being exchangeable. (In contrast, a uniform random labeling WW is row exchangeable and, conditioned on κ\kappa, column exchangeable.) Finally, note that the mean of the digamma⁡(r,c)\operatorname{digamma}(r,c) distribution exists for c>1c>1 and is given by

which increases with rr and decreases with cc. 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 TT 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 cc 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 rr 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 rr has a weak effect on the expected total number of features (seen in the third row of Figure 1), and cc 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 TT and cc determining the size and density of the array, and rr 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 nn groups of measurements y1,…,yny_{1},\ldots,y_{n}, where each group yiy_{i} is comprised of DiD_{i} measurements yi=(yi,1,…,yi,Di)y_{i}=(y_{i,1},\ldots,y_{i,D_{i}}). In particular, Wi,jW_{i,j} denotes the number of instances of object/factor jj in group ii.

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 nn 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 Wi,jW_{i,j} models the relative number of times object class jj appears in image ii. For every i≤ni\leq n, image yiy_{i} consists of DiD_{i} local patches yj,1,…,yj,Diy_{j,1},\ldots,y_{j,D_{i}} detected in the image, which are (collections of) continuous variables representing, for example, color, hue, location in the image, etc. Let κ\kappa be the number of columns of WW, that is, the number of features. The local patches in image ii are modeled as conditionally i.i.d. draws from a mixture of Si=∑j=1κWi,jS_{i}=\sum_{j=1}^{\kappa}W_{i,j} Gaussian distributions, where Wi,jW_{i,j} of these components are associated with feature jj. For k=1,2,…,k=1,2,\ldots, let Θi(j,k):=(mi(j,k),Σi(j,k))\Theta_{i}^{(j,k)}:=(m_{i}^{(j,k)},\Sigma_{i}^{(j,k)}) denote the mean and covariance of the Gaussian components associated with feature jj for image ii. Let zi,d=(j,k)z_{i,d}=(j,k) when yi,dy_{i,d} is assigned to component k≤Wi,jk\leq W_{i,j} associated with feature j≤κj\leq\kappa. Conditioned on Θ:=(Θi(j,k))i≤n,j≤κ,k≤Wi,j\Theta:=(\Theta_{i}^{(j,k)})_{i\leq n,j\leq\kappa,k\leq W_{i,j}} and the assignments z:=(zi,d)i≤n,d≤Diz:=(z_{i,d})_{i\leq n,d\leq D_{i}}, the distribution of the measurements admits a conditional density

To share statistical strength across images, the parameters Θi(j,k)\Theta_{i}^{(j,k)} are given a hierarchical Bayesian prior:

A typical choice for ν(⋅)\nu(\cdot) is the family of Gaussian–inverse-Wishart distributions with feature-specific parameters Θ(j)\Theta^{(j)} drawn i.i.d. from a distribution ν0\nu_{0}. Finally, for every image i≤ni\leq n, conditioned on WW, the assignment variables zi,1,…,zi,Diz_{i,1},\ldots,z_{i,D_{i}} for the local patches in image nn are assumed to form a multivariate Pólya urn scheme, arising from repeated draws from a Dirichlet-distributed probability vector over {(j,k):j≤κ,k≤Wi,j}\{(j,k):j\leq\kappa,k\leq W_{i,j}\}. The parameters for the Dirichlet distributions are tied in a similar fashion to Θ\Theta. The interpretation here is that local patch dd in image ii is assigned to one of the SiS_{i} 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 yi,vy_{i,v} be the number of occurrences of word vv in document ii. Conditioned on WW and a collection of non-negative topic-word weights Θ:=(θj,v)j≤κ,v≤V\Theta:=(\theta_{j,v})_{j\leq\kappa,v\leq V}, the word counts are assumed to be conditionally i.i.d. and

In other words, the expected number of occurrences of word vv in document ii is a linear sum of a small number of weighted factors. The features here are interpreted as topics: words vv such that θj,v\theta_{j,v} is large are likely to appear many times. There are a total of κ\kappa topics that are shared across the documents. The topic-word weights Θ\Theta 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 yi,vy_{i,v} represents the rating a Netflix user ii assigns to a film vv.

3 Conditional distributions

Let WW 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 WW 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 WW. This approach has some advantages, including that the entries of WW 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 κ\kappa, let Θ=(θ1,…,θκ)\Theta=(\theta_{1},\ldots,\theta_{\kappa}) be an i.i.d. sequence drawn from some non-atomic distribution νΘ\nu_{\Theta}, and assume that the data yy admits a conditional density p(y∣W,Θ)p(y|W,\Theta). We will associate the jjth column of WW with Θj\Theta_{j}, and so the pair (W,Θ)(W,\Theta) can be seen as an alternative representation for an exchangeable sequence X[n]X_{[n]} of beta negative binomial processes. By Bayes’ rule, the posterior distributions admits a conditional density

where p(W,Θ)p(W,\Theta) is a density for the joint distribution of (W,Θ)(W,\Theta). 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 Wi,jW_{i,j}, conditioned on the remaining elements of the array (collectively denoted by W−(i,j)W_{-(i,j)}), the data yy, and the parameters Θ\Theta. By Bayes’ rule, and the independence of Θ\Theta and WW given κ\kappa, we have

Recall that the array WW is row-exchangeable, and so, in the language of the NB-IBP, we may associate the iith row with the final customer at the buffet. The count Wi,jW_{i,j} is the number of servings the customer takes of dish jj, which has been served Sj(−i):=∑i′≠iWi′,jS_{j}^{(-i)}:=\sum_{i^{\prime}\neq i}W_{i^{\prime},j} times previously. When Sj(−i)>0S_{j}^{(-i)}>0, 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 j′j^{\prime} such that Sj′(−i)=0S_{j^{\prime}}^{(-i)}=0. Simultaneously, we propose a corresponding change to the sequence of latent parameters Θ\Theta, preserving the relative ordering with the columns of WW. This corresponding change to Θ\Theta cancels out the effect of the κ!\kappa! term appearing in the p.m.f. of the array WW. Let JiJ_{i} 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 ii as the final customer at the buffet, JiJ_{i} 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 W∗W^{*} by removing the JiJ_{i} singleton columns from the array and insert Ji∗J_{i}^{*} new singleton columns at positions drawn uniformly at random, where Ji∗J_{i}^{*} is sampled from the (marginal) distribution of JiJ_{i} given in equation (63). Like those columns that were removed, each new column has exactly one non-zero entry in the iith row: We draw each non-zero entry independently and identically from a digamma⁡(r,c+(n−1)r)\operatorname{digamma}(r,c+(n-1)r) 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 Θ∗\Theta^{*} by removing those entries from Θ\Theta associated with the JiJ_{i} columns that were removed from WW and inserting Ji∗J_{i}^{*} new entries, drawn i.i.d. from νΘ\nu_{\Theta}, at the same locations corresponding to the Ji∗J_{i}^{*} newly introduced columns. Let κ∗:=κ−Ji+Ji∗\kappa^{*}:=\kappa-J_{i}+J_{i}^{*}, and note that there were (κ∗Ji∗){\kappa^{*}\choose J_{i}^{*}} 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 (W∗,Θ∗)(W^{*},\Theta^{*}) with probability min⁡{1,α∗}\min\{1,\alpha^{*}\}, where

Combined with appropriate Metropolis–Hastings moves that shuffle the columns of WW and resample the latent parameters Θ\Theta, we obtain a Markov chain whose stationary distribution is the conditional distribution of WW and Θ\Theta given the data yy.

Another benefit of the characterization of the distribution of WW in (6) is that numerically integrating over the real-valued concentration, mass, and negative binomial parameters cc, TT, and rr, respectively, are straightforward with techniques such as slice sampling . In the particular case when TT is given a gamma prior distribution, say T∼gamma⁡(α,β)T\sim\operatorname{gamma}(\alpha,\beta) for some positive parameters α\alpha and β\beta, 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.

References