<<

Gibbs Methods for Stick-Breaking Priors

Hemant Ishwaran and Lancelot F. James

A rich and  exible class of random probability measures, which we call stick-breaking priors, can be constructed using a sequence of independent beta random variables. Examples of random measures that have this characterization include the , its two- extension, the two-parameter Poisson–Dirichlet process, Ž nite dimensional Dirichlet priors, and beta two-parameter processes. The rich nature of stick-breaking priors offers Bayesians a useful class of priors for nonparametri c problems, while the similar construction used in each prior can be exploited to develop a general computational procedure for Ž tting them. In this article we present two general types of Gibbs samplers that can be used to Ž t posteriors of Bayesian hierarchical models based on stick-breaking priors. The Ž rst type of Gibbs sampler, referred to as a Pólya urn Gibbs sampler, is a generalized version of a widely used Gibbs sampling method currently employed for Dirichlet process computing. This method applies to stick-breaking priors with a known Pólya urn characterization, that is, priors with an explicit and simple prediction rule. Our second method, the blocked Gibbs sampler, is based on an entirely different approach that works by directly sampling values from the posterior of the random measure. The blocked Gibbs sampler can be viewed as a more general approach because it works without requiring an explicit prediction rule. We Ž nd that the blocked Gibbs avoids some of the limitations seen with the Pólya urn approach and should be simpler for nonexperts to use. KEY WORDS: Blocked Gibbs sampler; Dirichlet process; Generalized ; Pitman–Yor process; Pólya urn Gibbs sampler; Prediction rule; Random probability measure; Random weights; Stable law.

1. INTRODUCTION in the Gibbs sampling scheme. This allows direct sampling of the nonparametric posterior, leading to several computa- This article presents two Gibbs sampling methods for Ž t- tional and inferential advantages (see the discussion in Sec- ting Bayesian nonparametric and semiparametric hierarchical tions 5.3 and 5.4). Including the prior in the update is an models that are based on a general class of priors that we approach that is not always exploited when Ž tting nonpara- call stick-breaking priors. The two types of Gibbs samplers are quite different in nature. The Ž rst method is applicable metric hierarchical models. This is especially true for mod- when the prior can be characterized by a generalized Pólya urn els using Dirichlet process priors. Some notable exceptions mechanism and it involves drawing samples from the poste- were discussed by Doss (1994), who showed how to directly rior of a hierarchical model formed by marginalizing over the update the Dirichlet process in censored data problems, and prior. Our Pólya urn Gibbs sampler is a direct extension of the by Ishwaran and Zarepour (2000a), who updated approximate widely used Pólya urn sampler developed by Escobar (1988, Dirichlet processes in hierarchical models. Also see the liter- 1994), MacEachern (1994), and Escobar and West (1995) for ature regarding the beta process (Hjort 1990) in survival anal- Ž tting the Ferguson (1973, 1974) Dirichlet process. Although ysis for further examples of Bayesian computational methods here we focus on its application to stick-breaking priors (such that include the prior in the update (for example, see Damien, as the Dirichlet process), in principle, the Pólya urn Gibbs Laud, and Smith 1996 and Laud, Damien, and Smith 1998). sampler can be applied to any random probability measure 1.1 Stick-Breaking Priors with a known prediction rule. The prediction rule character- izes the Pólya urn description of the prior and is deŽ ned as A more precise deŽ nition will be given shortly, but for now the conditional distribution of a future observation Yn+ 1 given we note that stick-breaking priors are almost surely discrete previous sampled values Y11 : : : 1 Yn from the prior (as illustra- random probability measures ° that can be represented gen- tion, the prediction rule for the Dirichlet process leads to the erally as famous Blackwell–MacQueen Pólya urn; see Blackwell and MacQueen 1973 for more discussion). N °4 5 = p „ 4 51 (1) Our second method, the blocked Gibbs sampler, works in k Zk k=1 greater generality in that it can be applied when the Pólya X urn characterization is unknown. Thus, this method can be where we write „ 4 5 to denote a discrete measure concen- Zk used for a stick-breaking measure without needing to know trated at Zk. In (1), the pk are random variables (called ran- the prediction rule (in fact, we argue that sometimes even dom weights) chosen to be independent of Zk and such that N if one knows the prediction rule, the blocked Gibbs might 0 pk 1 and k=1 pk = 1 almost surely. It is assumed that still be preferable to Pólya urn sampling). A key aspect of Zk are iid random elements with a distribution H over a mea- the blocked Gibbs approach is that it avoids marginalizing surable Polish spacP e 4¹1 ¢4¹55, where it is assumed that H over the prior, thus allowing the prior to be directly involved is nonatomic (i.e., H8y9 = 0 for each y ¹). Stick-breaking priors can be constructed using either a2Ž nite or an inŽ nite number of terms, 1 N ; in some cases, we may even Hemant Ishwaran is Associate Staff, Department of Biostatistics and choose N to depend upon thˆe sample size n. Epidemiology/Wb4, Cleveland Clinic Foundation, 9500 Euclid Avenue, Cleveland, OH 44195 (E-mail: [email protected]). Lancelot James is The method of construction for the random weights is what Assistant Professor, Department of Mathematical Sciences, Johns Hopkins sets stick-breaking priors apart from general random measures University, Baltimore, MD 21218-2692 (E-mail: [email protected]). The authors are grateful to the reviewers of a Ž rst draft of this article, who provided some key insights that greatly improved the Ž nal version. This work was partially supported by the Acheson J. Duncan Fund for the Advancement © 2001 American Statistical Association of Research in , award 00-1, Department of Mathematical Sciences, Journal of the American Statistical Association Johns Hopkins University. March 2001, Vol. 96, No. 453, Theory and Methods 161 162 Journal of the American Statistical Association, March 2001

° expressible as (1). Call ° a ° 4a1 b5 random probability 1.1.2 The Case N = (InŽ nite dimensional priors). We N ˆ measure, or a stick-breaking random measure, if it is of the write ° 4a1 b5 to emphasize the case when N = . A ˆ ˆ form (1) and ° 4a1 b5 inŽ nite dimensional prior is only well deŽ ned if its randoˆ m weights sum to 1 with probability 1. The following lemma provides a simple method for checking this condition p = V and p = 41 V 541 V 5 1 1 k ƒ 1 ƒ 2 (see the Appendix for a proof).

41 Vk 15 Vk1 k 21 (2) ƒ ƒ Lemma 1. For the random weights in the ° 4a1 b5 random measure, ˆ where Vk are independent Beta4ak1 bk 5 random variables for a 1 b > 0, and where a = 4a 1 a 1 : : : 5 and b = 4b 1 b 1 : : : 5. ˆ ˆ k k 1 2 1 2 p = 1 a.s. iff E log41 V 5 = 0 (5) Informally, construction (2) can be thought of as a stick- k k k=1 k=1 ƒ ƒˆ breaking procedure, where at each stage we independently and X X randomly, break what is left of a stick of unit length and assign Alternatively, it is sufŽ cient to check that kˆ=1 log41 + the length of this break to the current p value. a =b 5 = + . k k k ˆ The stick-breaking notion for constructing random weights InŽ nite dimensional priors include the DirichlePt process, its has a very long history. For example, see Halmos (1944), two-parameter extension, the two-parameter Poisson–Dirichlet Freedman (1963), Fabius (1964), Connor and Mosimann process (Pitman and Yor 1997), and beta two-parameter pro- (1969), and Kingman (1974). However, our deŽ nition of a cesses (Ishwaran and Zarepour 2000a).

°N 4a1 b5 measure appears to be a new concept (to the best of our knowledge) and it provides a uniŽ ed way to connect a col- 1.2 Outline of the Text lection of seemingly unrelated measures scattered throughout The layout of this article is as follows. In Section 2, we dis- the literature. These include (a) the Ferguson Dirichlet pro- cuss the two-parameter Poisson–Dirichlet process, or what we cess (Ferguson 1973, 1974), (b) the two-parameter Poisson– refer to as the Pitman–Yor process (Pitman and Yor 1997). We Dirichlet process (Pitman and Yor 1997), (c) Dirichlet- recall its characterization in terms of the Poisson process and multinomial processes (Muliere and Secchi 1995), m-spike compare this construction to the simpler stick-breaking con- models (Liu 1996), Ž nite dimensional Dirichlet priors (Ish- struction that will be used in our blocked Gibbs sampler. We waran and Zarepour 2000b,c) and (d) beta two-parameter pro- also review its prediction rule and, thus, its characterization as cesses (Ishwaran and Zarepour 2000a). (This list is by no a Pólya urn which is needed for its computation via the Pólya complete, and we anticipate that more measures will urn sampler. Section 3 focuses on Ž nite dimensional °N 4a1 b5 eventually be recognized as being stick-breaking in nature.) measures and presents several important examples, includ- ing Ž nite dimensional Dirichlet priors (Ishwaran and Zarepour 1.1.1 The Case N < (Finite dimensional priors). The ˆ 2000c) and almost sure truncations of ° 4a1 b5 measures (see class of a b measures can be broken up into two groups, ˆ °N 4 1 5 Theorems 1 and 2 for methods for selecting truncation levels). depending on whether a Ž nite or inŽ nite number of beta ran- The generalized Pólya urn Gibbs sampler is presented in dom variables are used in its construction. When N < , we ˆ Section 4, including an acceleration step to improve mix- necessarily set VN = 1 to ensure that °N 4a1 b5 is well deŽ ned. ing of the . Theorem 3 characterizes the poste- In this case, we have a = 4a11 : : : 1 aN 15, b = 4b11 : : : 1 bN 15, ƒ ƒ rior under the Pitman–Yor prior in semiparametric hierarchical and models and can be used to estimate posterior function- als and their laws based on output from the Pólya urn sam- pler. Section 5 presents the blocked Gibbs sampler for Ž tting p = V and p = 41 V 541 V 5 1 1 k ƒ 1 ƒ 2 hierarchical models based on Ž nite dimensional stick-breaking 41 Vk 15 Vk1 k = 21 : : : 1 N 0 (3) priors (these include the priors mentioned in Section 3, and ƒ ƒ truncations and approximations of the Pitman–Yor process as N examples). We indicate some of the important properties of Setting VN = 1 guarantees that k=1 pk = 1 with probability 1, because the blocked Gibbs sampler, including its ease in handling P non-conjugacy and its good mixing behavior. Its good mix- N 1 ƒ ing properties are attributed to the manner in which it blocks 1 pk = 41 V15 41 VN 150 (4) ƒ and are due to its behavior as a data augmentation ƒ k=1 ƒ ƒ X procedure (see Section 5.3). Section 6 presents extensive sim- Section 3 shows that random weights deŽ ned in this man- ulations that compare the mixing behavior of our two Gibbs samplers under different priors. ner have the generalized Dirichlet distribution. One important consequence of this is that all Ž nite dimensional Dirichlet pri- 2. THE PITMAN–YOR PROCESS, °¹(a1b) ors (Ishwaran and Zarepour 2000c) can be seen to be °N 4a1 b5 measures. Another attribute of the generalized Dirichlet distri- The recently developed two-parameter Poisson–Dirichlet bution is its conjugacy to multinomial sampling. This property process of Pitman and Yor (1997) has been the subject of a is a key ingredient to implementing the blocked Gibbs sam- considerable amount of research interest. (see Pitman 1995, pler in Section 5. 1996a,b, 1997, 1999; Kerov 1995; Mekjian and Chase 1997; Ishwaran and James: Gibbs Sampling for Stick-Breaking Priors 163

Zabell 1997; Tsilevich 1997; Carlton 1999). However, because iid 1 where Vk Beta411 5,  > 0, and ƒ is the inverse of the most of this literature has appeared outside of statistics, it Lévy measure for a Gamma45 , has gone largely unnoticed that the process possesses sev- eral properties that make it potentially useful as a Bayesian ˆ 1 nonparametric prior. One such key property is its characteri- 4x5 =  exp4 u5uƒ du1 0 < x < 0 zation as a stick-breaking random measure by Pitman (1995, x ƒ ˆ Z 1996a). As shown there, the size-biased random permutation for the ranked random weights from the measure produces a Pitman and Yor (1997) established a parallel identity for sequence of random weights derived using a residual alloca- the °¹4a1 b5 process using its characterization in terms of tion scheme (Pitman 1996b), or what we are calling a stick- a subordinator of the Poisson process. In particular, for the breaking scheme. This then identiŽ es the process as a two- °¹41 05 process, Pitman and Yor (1997, Proposition 9) and parameter stick-breaking random measure with parameters Perman et al. (1992) proved the remarkable fact a = 1 a, b = b + ka, where 0 a < 1 and b > a (Pitman k ƒ k ƒ 1995, 1996a). Another key property of the process is its char- 1= ˆ â ƒ acterization as a generalized Pólya urn. As we will see, this 41 054 5 = k „ 4 5 °¹ 1= Zk ƒ characterization follows from an explicit description of its pre- k=1 kˆ=1 âk diction rule (see Section 2.2). X ¤ P ˆ For convenience, we refer to the two-parameter Poisson– = V1„Z 4 5 + 41 V1541 V25 1 ƒ ƒ Dirichlet process as the Pitman–Yor process, writing it as k=2 X °¹4a1 b5 to indicate its two shape parameters. The Ferguson 41 Vk 15 Vk „Z 4 51 (6) ƒ ƒ k (1973, 1974) Dirichlet process is one example of a °¹4a1 b5 process, corresponding to the measure °¹401 5 with parame- ind where V Beta41 1 k5 for 0 <  < 1. ters a = 0 and b = . For notation, we usually write DP4H5 k ƒ for this measure to indicate a Dirichlet process with Ž nite Note that both Poisson process constructions rely on ran- measure H. Another important example that we consider is dom weights constructed using inŽ nitely divisible random the °¹41 05 process with parameters a =  and b = 0. This variables. In the DP4H5 process, pk = Jk=J is the value 1 selection of shape parameters yields a measure whose ran- Jk = ƒ 4âk5 normalized by J = kˆ=1 Jk, a Gamma45 ran- dom weights are based on a stable law with index 0 <  < 1. dom variable. In the °¹41 05 process, pk = Jk=J is the value 1= P The DP4H5 and stable law °¹41 05 processes are key pro- of Jk = âkƒ normalized by the random variable J with a sta- cesses because they represent the canonical measures of the ble law with index 0 <  < 1. Pitman–Yor process (Pitman and Yor 1997, Corollary 21). In It is instructive to compare the complexity of the Poisson the following subsection, we look at these two processes in based random weights to their much simpler stick-breaking more detail and review their stick-breaking and Poisson pro- counterparts. For example, even trying to sample values from cess characterizations. the Poisson process construction is difŽ cult, because the denominator of each random weight involves an inŽ nite sum 2.1 Poisson Process Characterization (even the numerator can be hard to compute with certain Lévy measures, like in the case of the Dirichlet process). Earlier representations for the DP4H5 measure and other The stick-breaking characterization thus represents a tremen- measures derived from inŽ nitely divisible random variables dous innovation, making the the Pitman–Yor process more were constructed using Lévy measures applied to the Poisson amenable to nonparametric applications in much the same way point process (see Ferguson and Klass 1972). An unpub- lished thesis by McCloskey (1965) appears to be the Ž rst the Sethuraman (1994) construction does for the Dirichlet pro- work that drew comparisons between the Dirichlet process cesss. A perfect example to illustrate its utility is our blocked and beta random variable stick-breaking procedures. However, Gibbs sampler, which is able to exploit such stick-breaking it was not until Sethuraman (1994) that these connections constructions to Ž t hierarchical models based on approximate were formalized (also see Sethuraman and Tiwari 1982, Don- Pitman–Yor priors (see Sections 5 and 6 for more details). nelly and Joyce 1989, and Perman, Pitman, and Yor 1992).

Let âk = E1 + + Ek, where Ek are iid exp415 random vari- ables. Sethuraman (1994) established the following remark- 2.2 Generalized Pólya Urn Characterization able identity showing that the Dirichlet process deŽ ned by As shown by Pitman (1995, 1996a), the °¹4a1 b5 process Ferguson (1973) is a ° 4a1 b5 measure: also can be characterized in terms of a generalized Pólya ˆ urn mechanism. This important connection presents us with 1 ˆ ƒ 4â 5 DP4H54 5 = k „ 4 5 another Gibbs sampling method for Ž tting nonparametric mod- 1 Zk ˆ k=1 k=1 ƒ 4âk5 els based on this prior (see Section 4). X Call Y 1 : : : 1 Y a sample from the 4a1 b5 process if ˆ 1 n °¹ ¤ V „P4 5 41 V 541 V 5 = 1 Z1 + 1 2 k=2 ƒ ƒ X iid Yi P P1 i = 11 : : : 1 n1 P °¹4a1 b50 (7) 41 Vk 15 Vk „Z 4 51 ƒ ƒ k — 164 Journal of the American Statistical Association, March 2001

As shown in Pitman (1995, 1996a), the prediction rule for the although the Y11 : : : 1 Yn generated from this urn scheme are °¹4a1 b5 process is not a sample from the °¹4a1 b5 process, but instead are a sample from the random measure ° deŽ ned with symmetric Dirichlet random weights b + ami 8Yi Y11 : : : 1 Yi 19 = H4 5 2 — ƒ b + i 1 N ƒ Gk1 N iid  mi n a °4 5 = „ 4 51 G Gamma 0 (9) j1 i N Zk k1N N + ƒ „Y 4 51 i = 21 31 : : : 1 n1 k=1 k=1 Gk1 N b + i 1 j1 i j=1 ƒ X X In the followinP g section, we show that (9) is an example of where 8Y 1 : : : 1 Y 9 denotes the unique set of values in 11 i mi 1 i a °N 4a1 b5 measure. It is also a mixture of Dirichlet processes. 8Y11 : : : 1 Yi 19, each occurring with frequency nj1 i for j = Writing ° = DPN 4H5 to emphasize this connection, we can 11 : : : 1 m (noticƒ e that n + + n = i 1). express (9) in the notation of Antoniak (1974) as i 11 i mi 1 i From this, it follows that the joinƒt distribution for 4Y 1 : : : 1 Y 5 can be characterized equivalently by the follow- ¤ N 1 n DPN 4H54 5 = DP4ŽN 4Z1 55H 4dZ51 ing generalized Pólya urn scheme. Let † 1 : : : 1 † be iid H. If 1 n Z 0 1 and , then N a < b > a where Ž 4Z1 5 = „ 4 5=N is the empirical measure ƒ N k=1 Zk based on Z = 4Z11 : : : 1 ZN 5. Y1 = †11 P As shown in Ishwaran and Zarepour (2000b), the DPN 4H5

†i with probability random measure can be used to approximate integrable func- tionals of the Dirichlet process; that is, 4b + ami5=4b + i 151 4Yi Y11 : : : 1 Yi 15 = 8 ƒ (8) ƒ — >Yj1i with probability d <> DPN 4H54g5 DP4H54g5 4n a5=4b + i 15, ! j1i ƒ ƒ > for each real-valued measurable function g that is integrable for i = 21 31 : : : 1 n. :> with respect to H. Also see Kingman (1974), Muliere and 2.2.1 Exchangeability and Full Conditionals. The sam- Secchi (1995), Liu (1996), Walker and WakeŽ eld (1998),

pled values 8Y11 : : : 1 Yn9 produced from the urn scheme (8) Green and Richardson (1999), Neal (2000), and Ishwaran are exchangeable because they have the same law as values and Zarepour (2000a,c), who discussed this measure in dif- drawn using (7). Thus, by exchangeability, we can determine ferent contexts and under different names. For example,

the full conditional distribution for any Yi by knowing the full Muliere and Secchi (1995) referred to (9) as a Dirichlet- conditional of a speciŽ c Y ; the most convenient to describe multinomial processes, Liu (1996), in the context of impor-

being Yn, which we already have seen: tance sampling, dubbed it an m-spike model, and Ishwaran and Zarepour (2000b,c) referred to it as a Ž nite dimensional Dirichlet prior. 8Yn Y11 : : : 1 Yn 19 2 — ƒ m n 3. EXAMPLES OF °N (a1b) MEASURES b + amn nj1n a = H4 5 + ƒ „Y 4 50 b + n 1 b + n 1 j1 n 3.1 Generalized Dirichlet Random Weights ƒ j=1 ƒ X This prediction rule is the key component in the Pólya urn By considering Connor and Mosimann (1969), it follows Gibbs sampler described in Section 4, as it allows us to work that the law for the random weights p = 4p11 : : : 1 pN 5 deŽ ned by (3) is a generalized Dirichlet distribution. Write §¤4a1 b5 out the full conditionals for each Yi needed to run the sampler. for this distribution, where a = 4a11 : : : 1 aN 15 and b = Note that the special case when a = 0 and b =  > 0 corre- ƒ 4b11 : : : 1 bN 15. The density for p is sponds to the DP4H5 process and produces the Blackwell– ƒ MacQueen prediction rule N 1 ƒ â4ak + bk5 a1 1 aN 1 1 bN 1 1 n 1 ƒ ƒ ƒ ƒ ƒ  1 ƒ p1 pN 1 pN â4a 5â4b 5 ƒ 8Yn Y11: : : 1Yn 19= H4 5+ „Y 4 50 k=1 k k ƒ j 2 —  + n 1  + n 1 j=1 Y ƒ ƒ ³ b1´4a2+ b25 bN 2 4aN 1+ bN 1 5 X 41 P15 ƒ 41 PN 25 ƒ ƒ ƒ ƒ 1 (10) ƒ ƒ ƒ

2.2.2 A Finite Dimensional Dirichlet Prior. Another where Pk = p1 + + pk and â4 5 is the gamma function. important example of an exchangeable urn sequence (8) is From this fact, we can make the nice connection that derived using values a = =N , N n, and b =  > 0 (see all random measures based on Dirichlet random weights are ƒ Pitman 1995, 1996a). This yields °N 4a1 b5 measures. More precisely, let ° be a random mea- sure (1) with random weights p, where

8Yn Y11 : : : 1 Yn 19 p = 4p 1 : : : 1 p 5 Dirichlet4a 1 : : : 1 a 50 2 — ƒ 1 N 1 N mn 41 m =N 5 nj1n + =N = ƒ n H4 5 + „ 4 51 Then, by (10), it easily follows that p has a 4a1 b5 distri- Yj1 n §¤  + n 1 j=1  + n 1 N N ƒ ƒ bution with a = 4a11 : : : 1 aN 15 and b = 4 k=2 ak, k=3 ak, X ƒ P P Ishwaran and James: Gibbs Sampling for Stick-Breaking Priors 165

: : : 1 aN 5. In other words, ° is a °N 4a1 b5 measure. Ishwaran Note that the value of N needed to keep this value small and Zarepour (2000c) called such measures Ž nite dimen- rapidly increases as  approaches 1. Thus it may not be fea- sional Dirichlet priors and showed that they can be used as sible to approximate the °¹41 05 process over all  values. sieves in Ž nite normal mixture problems. A special case of If the °N 4a1 b5 measure is applied in a Bayesian hierarchi- a Ž nite dimensional Dirichlet prior is the DPN 4H5 process cal model as a prior, then an appropriate method for select- discussed in Section 2.2.2. In this case, a = 4=N 1 : : : 1 =N 5 ing N is to choose a value that yields a Bayesian marginal for some  > 0. density that is nearly indistinguishable from its limit. Suppose

that X = 4X11 : : : 1 Xn5 is the observed data derived from the 3.2 Almost Sure Truncations of ° (a1b) Measures Bayesian nonparametric hierarchical model ˆ

Another useful class of °N 4a1 b5 measures are constructed ind by applying a truncation to the ° 4a1 b5 measure. The trun- 4Xi Yi5  4Xi Yi51 i = 11 : : : 1 n1 ˆ — — cation is applied by discarding the N + 1, N + 21 : : : terms iid 4Yi P5 P1 in the ° 4a1 b5 random measure and replacing pN with 1 — ˆ ƒ p1 pN 1. Notice that this also corresponds to setting P °N 4a1 b50 ƒ ƒ ƒ VN = 1 in the stick-breaking procedure (3). Determination of an appropriate truncation level can be Then the Bayesian marginal density under the truncation °N = based on the moments of the random weights. Consider the °N 4a1 b5 equals following theorem, which can be used for truncating the °¹4a1 b5 measure. n Œ 4X5 = f4X Y 5P4dY 5 ° 4dP51 N i— i i N Theorem 1. Let p denote the random weights from a i=1 ¹ k Z YZ given °¹4a1 b5 measure. For each positive integer N 1 and ³ ´ where f4x y5 is the density for x given y. Thus to properly each positive integer r 1, let — select N , the marginal density ŒN should be close to its limit r Œ under the prior ° 4a1 b5. Consider the following theorem, ˆ ˆ r ˆ ˆ TN 4r1 a1 b5 = pk 1 UN 4r1 a1 b5 = pk0 the proof of which follows by arguments given in Ishwaran k=N k=N and James (2000). ³X ´ X Then Theorem 2. Let pk denote the random weights from a given 4a1 b5 measure. If denotes the distance, then N 1 4r5 ° 1 ¬1 ƒ 4b + ka5 ˆ ˜ ˜ E T 4r1 a1 b5 = 1 N 21 N 4b + 4k 15a + 154r5 N 1 n k=1 ƒ ƒ ŒN Œ 1 4 1 E pk 0 Y ˜ ƒ ˆ˜ ƒ and k=1 X 4r 15 In particular, for the 4a1 b5 process, we have 41 a5 ƒ °¹ E U 4r1 a1 b5 = E T 4r1 a1 b5 ƒ 1 N N 4r 15 4b + 4N 15a + 15 ƒ n ƒ ŒN Œ 1 441 E61 TN 411 a1 b57 5 ˜ ƒ ˆ˜ ƒ ƒ where ƒ4r5 = ƒ4ƒ + 15 4ƒ + r 15 for each ƒ > 0 and ƒ ƒ405 = 1. and, for the DP4H5 process,

See the Appendix for a proof. Several simpliŽ cations occur ŒN Œ 1 4n exp4 4N 15=50 for the moments of the DP4H5 process, which corresponds ˜ ƒ ˆ˜ ƒ ƒ to the case a = 0 and b = . We have For example, the last approximation shows that the sample

N 1 size makes almost no dent on the ¬1 distance in a Dirichlet  ƒ process approximation. For example, if n = 1051 N = 150, and E TN 4r1 a1 b5 =  + r 8  = 5, then we get an ¬1 bound of 4057 10ƒ . Therefore, and even for huge sample sizes, a mere truncation of N = 150 N 1  ƒ â4r5â4 + 15 leads to an approximating hierarchical model that is virtu- E U 4r1 a1 b5 = 0 N  + r â4 + r5 ally indistinguishable from one based on the DP4H5 prior. See Ishwaran and James (2000) for more discussion and for Notice that both expressions decrease exponentially fast in N applications of this truncation to estimate Ž nite mixtures of and, thus, for a moderate N , we should be able to achieve normals. Also see Muliere and Tardella (1998), who used an an accurate approximation. A precise bound is given in “…-truncation” to sample Dirichlet prior functionals. Theorem 2. For some ° 4a1 b5 measures a very large value ˆ for N may be necessary to achieve reasonable accuracy. For 4. PÓLYA URN GIBBS SAMPLERS example, in the °¹41 05 process based on a stable law ran- dom variable [see (6)], we have Stick-breaking measures can be used as practical and versatile priors in Bayesian nonparametric and semiparamet- N 1  ƒ 4N 15 ric hierarchical models. We discuss the slightly more gen- E T 411 a1 b5 = ƒ W 1 0 <  < 10 N 4 + 15 44N 25 + 15 eral semiparametric setting, which corresponds to the problem ƒ 166 Journal of the American Statistical Association, March 2001

where we observe data X = 4X11 : : : 1 Xn5, derived from the values from the posterior distribution  4Y1 ˆ X5 of (12), we hierarchical model iteratively draw values from the conditional distribution— s of

ind Y X 1 Y X 4Xi Yi1 ˆ5  4Xi Yi1 ˆ51 i = 11 : : : 1 n1 4Yi i1 ˆ1 51 i = 1 : : : 1 n1 4ˆ 1 50 — — — ƒ — iid 4Y P5 P1 In particular, each iteration of the Gibbs sampler draws the i— following samples: ˆ  4ˆ51

(a) 4Yi Y i1 ˆ1 X5 for each i = 11 : : : 1 n: The required con- P °1 (11) ƒ ditiona— l distributions are deŽ ned by where  4Xi Yi1 ˆ5 denotes the conditional distribution of Xi — d given Yi and ˆ. Here ˆ represents a Ž nite dimensional 8Yi Y i1 ˆ1 X9 2 < 2 — ƒ parameter, whereas the sequence Y11 : : : 1 Yn is unobserved m random elements with conditional distribution P sampled = q 8Yi ˆ1 Xi9 + q „Y 4 51 (13) 0 2 — j j from our stick-breaking prior °. Further extensions to (11) j=1 X are also possible, such as extensions to include hyperpa- where rameters for ˆ. The model also can be extended to include a mixture of random measures by extending the distribu- q 4b + am5 f 4X Y 1 ˆ5 H4dY 51 tion H for the Zk to include . See West, 0 i / ¹ — Muller¨ , and Escobar (1994), Escobar and West (1998), and Z q 4n a5 f4X Y 1 ˆ51 MacEachern (1998) for several examples of semiparametric j / j ƒ i— j hierarchical models of the form (11) based on the Dirichlet and these values are subject to the constraint that they process. m sum to 1, that is, j=0 qj = 1. Here we are dropping the dependence on i for notational simplicity and we write 4.1 Marginalized Hierarchical Models P 8Y1 1 : : : 1 Ym9 for the set of unique values in Y i, where ƒ A powerful Gibbs sampling approach for sampling the pos- each value occurs with frequency nj for j = 11 : : : 1 m. terior of (11) can be developed when the Y drawn from The expression f 4x y1ˆ5 refers to the density of x given i — ° can be characterized in terms of a generalized Pólya y and ˆ, and is assumed to be jointly measurable in urn scheme. This method works for both the °¹4a1 b5 x1 y, and ˆ. and DP 4H5 processes described in Section 2, which (b) 4ˆ Y1 X5: By the usual application of Bayes theorem, N — both generate Yi values from the urn mechanism (8). This this is the density approach generalizes the method discovered by Escobar (1988, n 1994), MacEachern (1994), and Escobar and West (1995) for f 4ˆ Y1 X5  4dˆ5 f 4Xi Yi1 ˆ50 Dirichlet process computing. — / i=1 — The method works by Ž rst integrating over P in (11) to Y create a marginalized semiparametric hierarchical model Conjugacy and Methods for Accelerating Mixing. As dis- cussed in Escobar (1988, 1994), computing the value for q0 ind in (13) is simpliŽ ed in the DP4H5 setting when there is con- 4X Y 1 ˆ5  4X Y 1 ˆ51 i = 11 : : : 1 n1 i— i i— i jugacy, and the same holds true in the more general setting as

4Y11 : : : 1 Yn5  4Y11 : : : 1 Yn51 well [i.e., by conjugacy, we mean that the distribution H is conjugate for Y in f4X Y 1 ˆ5]. Without conjugacy, the prob- ˆ  4ˆ51 (12) — lem of computing q0 becomes a more delicate issue. In this case, the various solutions that have been proposed for the where  4Y 1 : : : 1 Y 5 denotes the joint distribution for Y = 1 n DP4H5 process can be applied here as well. For example, 4Y 1 : : : 1 Y 5 deŽ ned by the underlying Pólya urn. 1 n see West et al. (1994), MacEachern and Mulle¨ r (1998), Walker The proposed Gibbs sampler exploits two key facts about and Damien (1998), or Neal (2000) for different approaches. the joint distribution for Y. First, that the Y are exchange- i Like the Escobar (1988, 1994) Pólya urn sampler, the gen- able and, second, that the full conditional distribution for at eralized Pólya urn sampler has a tendency to mix slowly if the least one Y can be written in closed form (by exchangeability i values of q become much larger than the value of q in (13). we can then automatically deduce the full conditional for any j 0 When this occurs, the sampler can get stuck at the current other Y ). unique values Y1 1 : : : 1 Ym of Y and it may take many itera- tions before any new Y values are generated. As a method to 4.2 Gibbs Sampling for circumvent this problem for the DP4H5 process, West et al. °¹(a1b) and DPN (H) Processes (1994) proposed resampling the unique values Y1 1 : : : 1 Ym at For simplicity, we describe the algorithm for the case when the end of each iteration of the Gibbs sampler. A general ver-

° is the °¹4a1 b5 or DPN 4H5 process, but, in principle, the sion of this method was described by MacEachern (1994). method can be used for any almost surely discrete measure In this acceleration method, the value for Y is reexpressed with an explicit prediction rule. Let Y i denote the subvector in terms of the unique values Y1 1 : : : 1 Ym and the cluster mem- ƒ of Y formed by removing the i-th coordinate. Then to draw bership C = 4C11 : : : 1 Cn5, where each Ci records which Yj Ishwaran and James: Gibbs Sampling for Stick-Breaking Priors 167

corresponds to the value for Yi; that is, Yi = Yj iff Ci = j. Theorem 3 provides a characterization for °4 X5, the In the original method proposed by MacEachern (1994), the posterior distribution of P given X, in the semiparametri— c Gibbs sampler was modiŽ ed to include a step to generate the model (11). It is a generalization of the result for the Dirichlet cluster membership C, which is then followed by an update process in Lo (1984, Theorem 1) to the Pitman–Yor process. for the unique Yj values given the current value for C. How- Also see Antoniak (1974, Theorem 3). A proof is given in the ever, a simpler approach is to run the original Gibbs sampler Appendix. to generate a current value for Y, and from this, compute the Theorem 3. Let – be a nonnegative or integrable function current membership C, and then update the unique Yj val- over 4­1 ¢4­55. If ° is the °¹4a1 b5 process, then °4 X5 ues given C. Details can be found in West et al. (1994), Bush — and MacEachern (1996), and Escobar and West (1998). In the in (11) is characterized by generalized Pólya urn sampler, the method works simply by adding the following third step: –4P5 °4dP X5 = –4P5 °4dP Y5  4dY X51 (14) ­ — ¹ n ­ — — (c) Draw samples from the conditional distributions for Z Z Z where 4Yj C1 ˆ1 X5 for j = 11 : : : 1 m. In particular, for each j, the —required conditional density is n  4dY5 d i=1 f4Xi Yi1 ˆ5  4dˆ5  4dY X5 = < — — n f4X Y 1 ˆ5  4dˆ5  4dY5 ¹ n d i=1 i i f 4Yj C1 ˆ1 X5 H4dYj 5 f 4Xi Yj 1 ˆ50 R Q — — / — < 8i 2 Ci=j9 Y and  4Y5 is the joinR Rt distributioQ n for Y determined by the Now use the newly sampled Yj and the current value for generalized Pólya urn (8). the cluster membership C to determine the new updated Furthermore, °4 Y5 is the posterior for the Pitman–Yor value for Y. process given Y, a —sample drawn from it, and, therefore, by considering Pitman (1996a, Corollary 20), it is the random 4.3 Limitations With Pólya Urn Gibbs Sampling probability measure

Although the generalized Pólya urn Gibbs sampler is a ver- m satile method for Ž tting Bayesian models, there are several 4 Y5 = p „ 4 5 + p 4 51 (15) ° j Yj m+ 1° limitations with this approach that are worth highlighting: — j=1 X (a) The method relies on the full conditional distribution where 8Y1 1 : : : 1 Ym9 are the unique set of Yi values occurring of 4Yi Y i1 ˆ1 X5, which results in a Gibbs sampler that with frequencies n and uses a— one-coordinate-at-a-timƒ e update for parameters. j This can produce large coefŽ cients, which result in qj 4p 1 : : : 1 p 1 p 5 Dirichlet4n a1 : : : 1 n a1 b + am5 a slowly mixing Markov chain. The simple accelera- 1 m m+ 1 1 ƒ m ƒ tion method discussed above can be applied to enhance is independent of ° , which is a °¹4a1 b + ma5 process. mixing in general, but in some cases these methods still suffer from slow mixing, because they implicitly rely Estimating Functionals. We can use (14) to estimate var- on one-at-a-time updates in some form or another. ious posterior mean functionals. Several popular choices for – are (b) Calculating the q0 coefŽ cient in (13) is problematic in the nonconjugate case. Although there are many pro- –4P5 = P4A5 = P4dy51 posed solutions, these tend to complicate the description A Z of the algorithm and may make them less accessible to which could be used to estimate the mean posterior cdf by nonexperts. choosing A to be a cylinder set, and (c) A third deŽ ciency arises from the effect of marginal-

izing over P. Although marginalizing is the key that –4P5 = k4x01 y5P4dy51 underlies the Pólya urn approach, it has the undesirable ¹ Z side effect that it allows inference for the posterior of which could be used to estimate the mean density at the point P to be based only on the posterior Y values. i x0 in density estimation problems where k4 1 5 is a kernel. To estimate (14) we average 4.4 Posterior Inference in the °¹ (a, b) Process m Theorem 3 can be used in the 4a1 b5 process to approx- nj a b + am °¹ –4P5 4dP Y5 = ƒ –4„ 5 + –4H5 ° Yj imate posterior mean functionals using the values of Y drawn ­ — j=1 b + n b + n from our Pólya urn Gibbs sampler. This provides a partial Z X solution to the third deŽ ciency highlighted in the previous over the different values of Y drawn using the Gibbs sampler. section. The expression on the right-hand side follows from (15). We assume that all relevant distributions are deŽ ned over The preceding method works for mean functionals because measurable Polish spaces. Thus H is a distribution over the of the simpliŽ cation that occurs from integrating. However, measurable Polish space 4¹1 ¢4¹55 and the prior  4ˆ5 for ˆ is if our interest is in drawing values directly from the law deŽ ned over the Borel space 4 d 1 ¢4 d 55. We also write ­ ¬4–4P5 X5, then we have to randomly sample a measure P < < — for the space of probability measures over ¹ and ¢4­5 for from the distribution of °4 Y5 to produce our posterior draw the corresponding ‘ algebra induced by weak convergence. –4P5. However, implementin— g this scheme cannot be done 168 Journal of the American Statistical Association, March 2001 without some form of approximation, because it is not possi- the conditional distributions of the blocked variables ble to get an exact draw from °4 Y5. To get around this, we — 4Z K1 ˆ1 X51 can approximate (15) with — 4K Z1 p1 ˆ1 X51 m — 4p K51 p „Y 4 5 + p ° 4 51 j j m+ 1 N — j =1 4ˆ Z1 K1 X50 (17) X — where °N 4 5 is some approximation to ° . One such Doing so eventually produces values drawn from the distribu- approximation could be based on the almost sure truncations tion of 4Z1 K1 p1 ˆ X5. Thus, each draw 4Z1 K1 p1 ˆ5 deŽ nes a — discussed in Section 3.2, with an appropriate truncation level random probability measure chosen using either Theorem 1 or Theorem 2. Another method N for approximating ° is to draw simulated data from its urn (8) P4 5 = p „ 4 51 k Zk with values a 2= a and b 2= b + am. The random measure k=1 based on a large number of these simulated values then closely X which (eventually) gives us the draw from the posterior °4 X5 approximates . ° that we seek. This overcomes one of the obstacles observe— d with Pólya urn Gibbs samplers, where inference for °4 X5 requires special methods like those discussed in Section 4.4— . 5. BLOCKED GIBBS SAMPLER Notice that the blocked Gibbs also can be used to sudy the The limitations with the Pólya urn Gibbs sampler high- posterior distribution  4Y X5 using Y = Z . i Ki lighted in Section 4.3 can be avoided by using what we call — the blocked Gibbs sampler. This method applies to Bayesian 5.2 Blocked Gibbs Algorithm nonparametric and semiparametric models similar to (11), but The work in Ishwaran and Zarepour (2000a) can be where the prior ° is assumed to be a Ž nite dimensional extended straightforwardly to derive the required conditional

°N 4a1 b5 measure (such as the Ž nite dimensional Dirichet pri- distributions (17). Let 8K1 1 : : : 1 Km 9 denote the set of current ors discussed in Section 3 and truncations to priors such as the m unique values of K. To run the blocked Gibbs, draw values Pitman–Yor process). The Ž nite dimensionality of such priors in the following order: is a key to the success of the method because it allows us to iid (a) Conditional for Z: Simulate Z H for each k express our model entirely in terms of a Ž nite number of ran- k K 8K 1 : : : 1 K 9. Also, draw 4Z K1 ˆ1 X5 from the2 1 m Kj dom variables. This then allows the blocked Gibbs sampler to densityƒ — update blocks of parameters, which, because of the nature of the prior, are drawn from simple multivariate distributions (in f 4ZK K1 ˆ1 X5 H4dZK 5 f4Xi ZK 1 ˆ51 particular, the update for p is straightforward because of its j — / j — j 8i 2 Ki =Kj 9 connection to the generalized Dirichlet distribution established Y in Section 3.1). j = 11 : : : 1 m0 (18) With a Ž nite dimensional prior P ° 4a1 b5, the Bayesian N (b) Conditional for K: Draw values semiparametric model (11) can be rewritten as N ind ind 4Ki Z1 p1 ˆ1 X5 pk1i „k4 51 i = 11 : : : 1 n1 4X Z1 K1 ˆ5  4X Z 1 ˆ51 i = 11 : : : 1 n1 — i— i— Ki k=1 N X iid where 4K p5 p „ 4 51 i— k k k=1 4p 1: : : 1p 5 p f4X Z 1ˆ51: : : 1p f 4X Z 1ˆ5 0 X 11i N 1i / 1 i— 1 N i— N 4p1 Z5  4p5 H N 4Z51

ˆ  4ˆ51 (16) (c) Conditional for p: By the conjugacy of the generalized Dirichlet distribution to multinomial sampling, it fol- lows that our draw is where K = 4K11 : : : 1 Kn5, Z = 4Z11 : : : 1 ZN 5, p = 4p11 : : : 1 pN 5 §¤4a1 b5, and Zk are iid H. The key to expression (16) is to notice that Yi equals ZK , where the Ki p1 =V1 and pk =41 V1 541 V2 5 41 Vk 15Vk 1 i ƒ ƒ ƒ ƒ act as classiŽ cation variables to identify the Zk associated k=21: : : 1N 11 with each Yi. ƒ where

5.1 Direct Posterior Inference N ind V Beta a M 1b M 1 Rewriting the model in the form (16) allows the blocked k k + k k + l l=k+ 1 Gibbs sampler to sample the posterior distribution °4 X5 X — for k=11: : : 1N 11 directly. The method works by iteratively drawing values from ƒ Ishwaran and James: Gibbs Sampling for Stick-Breaking Priors 169

and Mk records the number of Ki values that equal k. the blocked Gibbs sampler will perform as well or better than (d) Conditional for ˆ: As before, draw ˆ from the density the Pólya urn method. Section 6 offers some empirical evi- (remembering that Y =Z ) dence to support this claim. i Ki n 5.4 Nonconjugacy and Hierarchical Extensions f 4ˆ Z1K1X5  4dˆ5 f 4Xi Yi1ˆ50 — / i=1 — Another key feature of the blocked Gibbs sampler is that Y it easily handles the issue of conjugacy, a problem that arises 5.3 Mixing Properties: Blocking and only in the context of drawing values from (18). With conju- Data Augmentation gacy, the draw from (18) is done exactly, whereas the noncon- The good mixing properties of the blocked Gibbs sampler jugate case can be handled easily by using standard Markov can be attributed to its ability to update the blocked parameters Chain Monte Carlo methods such as Metropolis–Hastings, for Z1 K, and p using simple multivariate draws. This encourages example. We note that the draw for (18) is the same draw good mixing for these parameters, which in turn encourages used in the acceleration step for the Pólya urn sampler, so it adds no further complexity to the blocked Gibbs than already good mixing for the unobserved Yi values, which are updated simultaneously from these values. is seen in urn samplers. The success of the blocked Gibbs over the standard Pólya The blocked Gibbs sampler can be extended to accommo- urn sampler also can be attributed to the effect of data aug- date hierarchical extensions to (16). For example, the distribu- mentation. The blocked Gibbs does a type of data augmen- tion for H can be expanded to include hyperparameters (such tation by augmenting the parameters from the urn scheme to as a mean and parameter in the case that H is a ). It is also possible to place priors on the include the prior. Consider the DPN 4H5 measure deŽ ned in Section 2.2.2. In the Pólya urn Gibbs sampler for Ž tting (16) shape parameters a and b in the °N 4a1 b5 prior; see Ishwaran under this prior, we sample 4Y1 ˆ5 from the density propor- and Zarepour (2000a), who developed an exact update for the tional to Dirichlet process cluster parameter  and updates for some other beta two-parameter processes. n n 41 m =N 5 f 4X Y 1 ˆ5 ƒ i H4dY 5 i— i  + i 1 i 6. COMPARISON OF i=1 i=1 ƒ Y Y mi In this section, we present some empirical evidence that nj1 i + =N + „Y 4dYi5  4dˆ5 compares the mixing performance for the Pólya urn Gibbs  + i 1 j1 i j=1 ƒ sampler (PG sampler) of Section 4.2, the accelerated version n X n (PGa sampler), and the blocked Gibbs sampler (BG sampler) = f4X Y 1 ˆ5 P4dY 5 4dP5 i i i °ŽN described in Section 5.2. We study each of these methods by i=1 — i=1 Y ZZ Y applying them to the nonparametric hierarchical model N H 4dZ5  4dˆ51 ind 4X Y 5 N4Y 1 ‘51 i = 11 : : : 1 n1 i— i i ind where °Ž is the Dirichlet process with Ž nite measure 4Y P5 P1 N i— ŽN 4Z1 5 for a Ž xed value of Z. If we augment the parameters to include Z and the random P °1 (19) measure P, we now sample 4Y1 ˆ1 Z1 P5 from the density pro- with the distribution H of the Z used in ° chosen to be the portional to k normal distribution N401 A5. n n In the Pólya urn Gibbs samplers, the value of q0 for each f 4X Y 1 ˆ5 P4dY 5 4dP5 H N 4dZ5  4dˆ5 i i i °ŽN Yi and its Xi observation is proportional to i=1 — i=1 Y Y 2 n n N b + am Xi = f 4X Y 1 ˆ5 p „ 4dY 5 exp ƒ 0 (20) i i k ZK i 2 4‘ + A5 24‘ + A5 i=1 — i=1 k=1 Y Y X  4dp5 H N 4dZ5  4dˆ51 When A is veryplarge compared to b + am, this value becomes very small and suppresses the ability of the PG sampler to mix where  4dp5 is the density for a Dirichlet4=N 1 : : : 1 =N 5 well. We look at this case, which is an example similar to the distribution. Notice that after transforming Y to Z , this den- one studied by MacEachern (1994), and illustrates why the i Ki sity is exactly the same density used by the blocked Gibbs PGa sampler improves mixing. We see that the BG sampler sampler. also performs well in this example.

Thus in the DPN 4H5 case, the blocked Gibbs sampler is We set ‘ = 1 and A = 25, and simulated n = 50 obser- doing an exact augmentation. However, because the DPN 4H5 vations Xi from a standard normal distribution. The Pólya measure is a good approximation to the Dirichlet process, our urn Gibbs samplers were applied to three different priors °: argument also shows that the blocked Gibbs sampler under the (1) the DP4H5 process with  = 1, (2) the DPN 4H5 pro- DPN 4H5 prior acts like an approximate data augmentation cess with N = 50,  = 1, and (3) the °¹41 05 process with procedure in the Dirichlet process Pólya urn Gibbs sampler.  = 0025, that is, the random measure (6) based on a sta- Thus, at least for the Dirichlet process, we can anticipate that ble random variable with index  = 0025. The BG sampler 170 Journal of the American Statistical Association, March 2001

also was applied to the DPN 4H5 prior, but we substituted nonconjugate models, we expect the BG sampler to mix more °N 4a1 b5 almost sure truncations for priors 1 and 3 by using efŽ ciently. the methods of Section 3.2. For the DP4H5 prior we used a truncation value of N = 50 and for the °¹400251 05 pro- APPENDIX: PROOFS cess we used N = 100. These values produce almost identical A.1 PROOF OF LEMMA 1 models by Theorem 2. To establish (5), take the limit of (4) as N and take logs to In each case we used a 2,000 iteration burn-in. After this we ! ˆ sequentially collected 1,000 batches of sampled values, each see that, of size B. For each batch we computed the 0.05, 0.25, 0.75, ˆ ˆ p = 1 a.s. iff log41 V 5 = a.s. and 0.95 percentile, as well as the mean, for each of the Yi k k k=1 k=1 ƒ ƒˆ values. We then computed the mean value and standard devia- X X tion over the 1,000 batches for each of the summary statistics The expression on the right-hand side is a sum of independent ran- for each Yi value. The averaged value over i is the (averaged) dom variables and, therefore, by the Kolmogorov three series theorem mean value and (averaged) standard deviation value we report equals almost surely iff ˆ E log41 V 5 = . ƒˆ k=1 ƒ k ƒˆ in Tables 1–3, which correspond to B = 501 1001 250. A small Alternatively, by (4), P standard deviation is evidence of good mixing. ˆ E4 kˆ=N + 1 pk5 ˆ ˆ bN As expected, the PG sampler performance is poor in all = E41 VN 5 = 0 E4 ˆ p 5 ƒ a + b examples, with standard deviations much larger than those N =1 P k=N k N =1 N =1 N N Y Y Y seen in the PGa and BG sampler. Both the PGa and BG sam- P If Nˆ=1 log41 + aN =bN 5 = + , then the right-hand side equals zero pler perform well in all the examples; both exhibit fairly simi- Nˆ N and we must have that E4 k=1 pk5 1. However, because k=1 pk lar behavior, but with the slight edge going to the PG sampler P ! a is positive and increasing, it follows that kˆ=1 pk = 1 almost surely. for the Dirichlet process priors 1 and 2, and to the BG sam- P P pler for the Pitman–Yor process (prior 3). We suspect that the A.2 PROOF OF THEOREM 1 P

PGa sampler did not do as well as the BG sampler in prob- Let ° be a speciŽ c °¹4a1b5 random measure. Then lem 3 because of the way q0 depends on the number of clus- ters m. Notice that by (20), the value for q is determined by 0 °4 5 = V „ 4 5 + 41 V 5 V „ 4 5 + 41 V 5V „ 4 5 am = m=4 (a = 00251 b = 0), which becomes as small as 1=4 1 Z1 ƒ 1 1 Z1 ƒ 1 2 Z2 when m 1. = + 41 V 541 V 5V „ 4 5 + 1 Our overall experiences with the three Gibbs sampling ƒ 1 ƒ 2 3 Z3 methods lead us to conclude that the accelerated PGa sam- where V = V are independent Beta41 a1 b + a + ka5 random pler always should be applied in place of the PG sampler. The k k+ 1 ƒ variables and Zk = Zk+ 1 are iid H. From this, deduce that extra computations required are minimal and are more than offset by the improved mixing. We suspect that the PG sam- ¤ 1 a °4 5 = V1 „Z1 4 5 + 4 V15 ° 4 51 pler might be slightly more efŽ cient than the BG sampler with ƒ small sample sizes in conjugate nonparametric models with where, on the right-hand side, V11 Z1, and ° are mutually indepen- the Dirichlet process, but with other types of priors and in dent, and ° is a °¹4a1b + a5 process.

Table 1. Mean Value and Standard Deviation Over 1,000 Batches, Each of Size B = 50

PG PGa BG

Prior Statistic Mean s.d. Mean s.d. Mean s.d.

DP(H) .05 percentile 0512 .253 0711 .126 0686 .136 .25 percentile ƒ0388 .199 ƒ0488 .051 ƒ0474 .057 mean ƒ0313 .149 ƒ0323 .055 ƒ0321 .056 .75 percentile ƒ0259 .223 ƒ0178 .071 ƒ0189 .079 .95 percentile ƒ0048 .308 ƒ0133 .178 ƒ0112 .183 ƒ

DPN (H) .05 percentile 0513 .242 0714 .128 0690 .129 .25 percentile ƒ0399 .187 ƒ0490 .052 ƒ0474 .053 mean ƒ0326 .144 ƒ0322 .056 ƒ0322 .055 .75 percentile ƒ0281 .215 ƒ0174 .074 ƒ0190 .077 .95 percentile ƒ0060 .315 ƒ0138 .183 ƒ0112 .179 ƒ °¹(002510) .05 percentile 0336 .171 0601 .081 0582 .082 .25 percentile ƒ0305 .129 ƒ0444 .038 ƒ0433 .038 mean ƒ0287 .122 ƒ0323 .042 ƒ0322 .039 .75 percentile ƒ0285 .149 ƒ0224 .056 ƒ0226 .047 .95 percentile ƒ0193 .206 ƒ0009 .125 ƒ0027 .128 ƒ ƒ

NOTE: Summary statistics are evaluated for each Yi (i = 11: : : 1n = 50), for each of the 1,000 batches. The mean and standard deviations over the 1,000 batches for each Yi are computed. The average value over i is the reported (averaged) mean and (averaged) standard deviation. Output is based on the model (19) via the Pólya urn Gibbs sampler (PG sampler) of Section 4.2, the accelerated version (PGa sampler), and the blocked Gibbs sampler (BG sampler) of Section 5.2. Ishwaran and James: Gibbs Sampling for Stick-Breaking Priors 171

Table 2. Mean Value and Standard Deviation Over 1,000 batches, Each of Size B = 100, for Different Summary Statistics From Model (19)

PG PGa BG

Prior Statistic Mean s.d. Mean s.d. Mean s.d.

DP(H) .05 percentile 0527 .235 0726 .102 0704 .111 .25 percentile ƒ0411 .179 ƒ0490 .036 ƒ0478 .040 mean ƒ0326 .130 ƒ0322 .040 ƒ0323 .041 .75 percentile ƒ0271 .205 ƒ0172 .052 ƒ0187 .060 .95 percentile ƒ0029 .293 ƒ0151 .143 ƒ0129 .150 ƒ

DPN (H) .05 percentile 0528 .227 0721 .098 0704 .106 .25 percentile ƒ0409 .173 ƒ0490 .036 ƒ0477 .038 mean ƒ0328 .126 ƒ0322 .039 ƒ0322 .039 .75 percentile ƒ0276 .198 ƒ0174 .051 ƒ0187 .057 .95 percentile ƒ0041 .290 ƒ0149 .142 ƒ0130 .142 ƒ °¹(002510) .05 percentile 0347 .182 0603 .059 0586 .065 .25 percentile ƒ0322 .154 ƒ0444 .027 ƒ0435 .028 mean ƒ0298 .142 ƒ0322 .030 ƒ0322 .029 .75 percentile ƒ0294 .179 ƒ0225 .041 ƒ0229 .034 .95 percentile ƒ0191 .226 ƒ0019 .088 ƒ0011 .102 ƒ ƒ

NOTE: Mean values and standard deviations are computed as in Table 1.

Similar reasoning shows that where all the variables on the right-hand side are mutually indepen- dent. Taking expectations, we have U 4r1 a1b5 =¤ V r + 41 V 5r U 4r1 a1b + a51 1 1 ƒ 1 1 N 1 4r 15 ƒ r 41 a5 ƒ where, on the right-hand side, V and U 4r1 a1 b + a5 are mutually E UN 4r1 a1 b5 = E 1 Vk5 ƒ 1 1 1 ƒ 4b + 4N 15a + 154r 15 independent. Therefore, taking expectations, k=1 ƒ ƒ Y 4r5 4r5 41 a5 4b + a5 where the product is identiŽ ed as E TN 4r1 a1b5 by noting that E U 4r1 a1b5 = ƒ + E U 4r1 a1b + a5 0 1 4b + 154r5 4b + 154r5 1 ¤ r r TN 4r1 a1b5 = 41 V15 41 VN 15 T14r1 a1b + 4N 15a5 It is easy to check that the solution to this is ƒ ƒ ƒ ƒ r r 4r 15 = 41 V15 41 VN 15 0 41 a5 ƒ ƒ ƒ ƒ E U 4r1 a1b5 = ƒ 0 1 4b + 154r 15 ƒ A.3 LEMMA FOR PROOF OF THEOREM 3 Furthermore, for N 2, we have that The following lemma is a key fact that we need in the proof of Theorem 3. It is an extension of Lo’s (1984, Lemma 1) work to the ¤ r r UN 4r1 a1 b5 = 41 V15 41 VN 15 U14r1 a1b + 4N 15a51 Pitman–Yor case. ƒ ƒ ƒ ƒ

Table 3. Mean Value and Standard Deviation Over 1,000 Batches, Each of Size B = 250, for Different Summary Statistics From Model (19)

PG PGa BG

Prior Statistic Mean s.d. Mean s.d. Mean s.d.

DP(H) .05 percentile 0553 .205 0728 .065 0710 .081 .25 percentile ƒ0421 .165 ƒ0491 .023 ƒ0478 .028 mean ƒ0326 .111 ƒ0323 .026 ƒ0322 .027 .75 percentile ƒ0256 .183 ƒ0171 .033 ƒ0185 .040 .95 percentile ƒ0011 .253 ƒ0157 .094 ƒ0136 .106 ƒ

DPN (H) .05 percentile 0548 .208 0728 .064 0708 .073 .25 percentile ƒ0417 .161 ƒ0491 .023 ƒ0476 .024 mean ƒ0324 .106 ƒ0322 .025 ƒ0322 .025 .75 percentile ƒ0257 .179 ƒ0171 .032 ƒ0186 .037 .95 percentile ƒ0017 .252 ƒ0157 .092 ƒ0137 .096 ƒ °¹(002510) .05 percentile 0377 .158 0607 .038 0588 .042 .25 percentile ƒ0358 .142 ƒ0444 .019 ƒ0433 .018 mean ƒ0325 .125 ƒ0322 .019 ƒ0321 .019 .75 percentile ƒ0319 .169 ƒ0227 .025 ƒ0228 .022 .95 percentile ƒ0199 .199 ƒ0026 .050 ƒ0002 .067 ƒ ƒ

NOTE: Mean values and standard deviations are computed as in Table 1. 172 Journal of the American Statistical Association, March 2001

Lemma 2. Let g be any nonnegative or quasiintegrable func- Damien, P., Laud, P. W., and Smith, A. F. M. (1996), “Implementa- tion on the measurable Polish space 4¹n ­1 ¢4¹n5 ¢4­55. Let tion of Bayesian Non-Parametric Inference Based on Beta Processes,” † Scandinavian Journal of Statistics, 23, 27–36. Y 1 : : : 1 Y be a sample drawn from the °¹4a1b5 process °. Then 1 n Donnelly, P., and Joyce, P. (1989), “Continuity and Weak Convergence of Ranked and Size-Biased Permutations on the InŽ nite Simplex,” Stochastic Processes and Applications, 31, 89–103. g4Y1 P5 P4dY15 P4dYn5 °4dP5 ­ ¹n Doss, H. (1994), “Bayesian Nonparametric Estimation for Incomplete Data Z Z via Successive Substitution Sampling,” The Annals of Statistics, 22, = g4Y1 P5 °4dP Y5  4dY51 1763–1786. ¹ n ­ — Escobar, M. D. (1988), “Estimating the Means of Several Normal Populations Z Z by Nonparametric Estimation of the Distribution of the Means,” unpub- where °4 Y5 is the posterior for ° based on Y = 4Y 1 : : : 1 Y 5 as lished Ph.D. thesis, Yale University, Dept. of Statistics. — 1 n deŽ ned by (15) and  4Y5 is the joint distribution for Y as deŽ ned (1994), “Estimating Normal Means With a Dirichlet Process Prior,” by the generalized Pólya urn (8). Journal of the American Statistical Association, 89, 268–277. Escobar, M. D., and West, M. (1995), “Bayesian Density Estimation and Proof. The lemma is a special case of the Fubini–Tonelli theorem Inference Using Mixtures,” Journal of the American Statistical Association, and the result follows because we have identiŽ ed the appropriate 90, 577–588. disintegrations for the product measure (1998), “Computing Nonparametric Hierarchical Models,” in Practi- cal Nonparametric and Semiparametric , eds. D. Dey, P. Mueller, and D. Sinha, New York: Springer-Verlag, 1–22. P4dY 5 P4dY 5 4dP5 1 n ° Fabius, J. (1964), “Asymptotic Behavior of Bayes Estimates,” Annals of Mathematical Statistics, 35, 846–856. of 4Y1 P5. Ferguson, T. S. (1973), “A Bayesian Analysis of Some Nonparametric Prob- lems,” The Annals of Statistics, 1, 209–230. A.4 PROOF OF THEOREM 3 (1974), “Prior Distributions on Spaces of Probability Measures,” The We follow the style of proof used in Lo (1984, Theorem 1). By Annals of Statistics, 2, 615–629. Bayes rule, °4P X5 is characterized by Ferguson, T. S., and Klass, M. J. (1972), “A Representation of Independent — Increment Processes Without Gaussian Components,” The Annals of Math- ematical Statistics, 43, 1634–1643. –4P5°4dP X5 Freedman, D. (1963), “On the Asymptotic Behavior of Bayes Estimates in ­ — the Discrete Case,” Annals of Mathematical Statistics, 34, 1386–1403. Z –4P5 n f 4X Y 1 ˆ5 P4dY 5  4dˆ5 4dP5 Green, P., and Richardson, S. (1999), “Modelling Heterogeneity With and ­ d i=1 ¹ i i i ° Without the Dirichlet Process,” unpublished manuscript. = < n — 0 (21) d f 4X Y 1 ˆ5 P4dY 5  4dˆ5 °4dP5 Halmos, P. (1944), “Random Alms,” The Annals of Mathematical Statistics, R ­ R i=Q1 ¹ R i i i < — 15, 182–189. By Fubini’Rs theoremR Q , weR can rewrite the numerator as Hjort, N. L. (1990), “Nonparametric Bayes Estimators Based on Beta Pro- cesses in Models for Life History Data,” The Annals of Statistics, 18, n 1259–1294. –4P5 f 4Xi Yi1 ˆ5 P4dY15 P4dYn5 °4dP5  4dˆ50 d n Ishwaran, H., and James, L. F. (2000), “Approximate Dirichlet Process Com- ­ ¹ i=1 — Z< Z Z puting for Finite Normal Mixtures: Smoothing and Prior Information,” Y unpublished manuscript. By applying Lemma 2 to the integrand where g4Y1 P5 corresponds Ishwaran, H., and Zarepour, M. (2000a), “ in to the expression in square brackets, the previous expression now Approximate Dirichlet and Beta Two-Parameter Process Hierarchical Mod- becomes els,” Biometrika, 87, 371–390. (2000b), “Exact and Approximate Sum-Representations for the Dirichlet Process,” unpublished manuscript. n (2000c), “Dirichlet Prior Sieves in Finite Normal Mixtures,” unpub- f 4Xi Yi1 ˆ5 –4P5 °4dP Y5  4dY5  4dˆ5 lished manuscript. d n ¹ i=1 — ­ — Kerov, S. (1995), “Coherent Random Allocations and the Ewens–Pitman For- Z< Z Z Y n mula,” PDMI Preprint, Steklov Institute of Mathematics, St. Petersburg.

= –4P5°4dP Y5 f 4Xi Yi1 ˆ5 4dˆ5  4dY50 Kingman, J. F. C. (1974), “Random Discrete Distributions,” Journal of the ¹ n ­ — d — < i=1 Royal Statistical Society, Series B, 37, 1–22. Z Z Z Y Laud, P. W., Damien, P., and Smith, A. F. M. (1998), “Bayesian Nonparamet- The last rearrangement follows from the Fubini–Tonelli theorem. ric and Covariate Analysis of Failure Time Data,” in Practical Nonpara- Applying this same argument to the denominator of (21) with metric and Semiparametric Bayesian Statistics, eds. D. Dey, P. Mueller, –4P5 = 1 results in the expression (14). and D. Sinha, New York: Springer-Verlag, pp. 213–225. Liu, J. S. (1996), “Nonparametric Hierarchical Bayes via Sequential Imputa- tions,” The Annals of Statistics, 24, 911–930. [Received February 2000. Revised July 2000.] Lo, A. Y. (1984), “On a Class of Bayesian Nonparametric Estimates: I. Den- sity Estimates,” The Annals of Statistics, 12, 351–357. REFERENCES MacEachern, S. N. (1994), “Estimating Normal Means With a Conjugate Style Dirichlet Process Prior,” Communications in Statistics—Simulations, Antoniak, C. E. (1974), “Mixtures of Dirichlet processes With Applications to 23, 727–741. Bayesian Nonparametric Problems,” The Annals of Statistics, 2, 1152–1174. (1998), “Computational Methods for Mixture of Dirichlet Process Blackwell, D. and MacQueen, J. B. (1973), “Ferguson Distributions via Polya Models,” in Practical Nonparametric and Semiparametric Bayesian Statis- Urn Schemes,” The Annals of Statistics, 1, 353–355. tics, eds. D. Dey, P. Mueller, and D. Sinha, New York: Springer-Verlag. Bush, C. A., and MacEachern, S. N. (1996), “A Semiparametric Bayesian MacEachern, S. N., and Muller¨ , P. (1998), “Estimating Mixture of Dirichlet Model for randomised Block Designs,” Biometrika, 83, 275–285. Process Models,” Journal of Computational and Graphical Statistics, 7, Carlton, M. A. (1999), “Applications of the Two-Parameter Poisson– 223–238. Dirichlet Distribution,” unpublished Ph.D. thesis, University of California, McCloskey, J. W. (1965), “A Model for the Distribution of Individuals by Los Angeles, Dept. of Statistics. Species in an Environment,” unpublished Ph.D. thesis, Michigan State Connor, R. J., and Mosimann, J. E. (1969), “Concepts of Independenc e for University. Proportions With a Generalization of the Dirichlet Distribution,” Journal of Mekjian A. Z., and Chase, K. C. (1997), “Disordered Systems, Power Laws the American Statistical Association, 64, 194–206. and Random Processes,” Physics Letters A, 229 340–346. Ishwaran and James: Gibbs Sampling for Stick-Breaking Priors 173

Muliere, P., and Secchi, P. (1995), “A Note on a Proper Bayesian Bootstrap,” Pitman, J. and Yor, M. (1997), “The Two-Parameter Poisson–Dirichlet Dis- Technical Report 18, Università degli Sudi di Pavia, Dipartimento di Econo- tribution Derived From a Stable Subordinator,” The Annals of Probability, mia Politica e Metodi Quantitativi. 25, 855–900. Muliere, P., and Tardella, L. (1998), “Approximating Distributions of Random Sethuraman, J. (1994), “A Constructive DeŽ nition of Dirichlet Priors,” Statis- Functionals of Ferguson–Dirichlet Priors,” Canadian Journal of Statistics, tica Sinica, 4, 639–650. 26, 283–297. Sethuraman, J., and Tiwari, R. C. (1982), “Convergence of Dirichlet Measures Neal, R. M. (2000), “Markov Chain Sampling Methods for Dirichlet Process and the Interpretation of Their Parameters,” Statistical Decision Theory and Mixture Models,” Journal of Computational and Graphical Statistics, 9, Related Topics III, 2, 305–315. 249–265. Tsilevich, N. V. (1997), “Distribution of the Mean Value for Certain Ran- Perman, M., Pitman, J., and Yor, M. (1992), “Size-Biased Sampling of Poisson dom Measures,” POMI Preprint 240, Steklov Institute of Mathematics, Point Processes and Excursions,” Probability Theory and Related Fields, St. Petersburg. 92, 21–39. Walker, S., and Damien, P. (1998), “Sampling Methods for Bayesian Non- Pitman, J. (1995), “Exchangeable and Partially Exchangeable Random Parti- parametric Inference Involving Stochastic Processes,” in Practical Non- tions,” Probability Theory amd Related Fields, 102, 145–158. parametric and Semiparametric Bayesian Statistics, ed. D. Dey, P. Muller,¨ (1996a), “Some Developments of the Blackwell–MacQueen Urn and D. Sinha, New York: Springer-Verlag, pp. 243–254. Scheme,” in Statistics, Probability and Game Theory, eds. T. S. Ferguson, Walker, S., and WakeŽ eld, J. (1998), “Population models With a Nonpara- L. S. Shapley, and J. B. MacQueen, IMS Lecture Notes—Monograph metric Random CoefŽ cient Distribution,” Sankhya, Ser. B, 60, 196–214. Series (Vol. 30), Hayward, CA: Institute of Mathematical Statistics, West, M., Muller¨ , P., and Escobar, M. D. (1994), “Hierarchical Priors and pp. 245–267. Mixture Models, With Applications in Regression and Density Estimation,” (1996b), “Random Discrete Distributions Invariant Under Size-Biased in A tribute to D. V. Lindley, eds. A. F. M Smith and P. R. Freeman, Permutation,” Advances in Applied Probability 28, 525–539. New York: Wiley. (1997), “Partition Structures Derived From Brownian Motion and Zabell, S. L. (1997), “The Continuum of Inductive Methods Revisited,” in The Stable Subordinators,” Bernoulli, 3, 79–86. Cosmos of Science, eds. J. Earman and J. D. Norton, Pittsburgh–Konstanz (1999), “Coalescents With Multiple Collisions,” The Annals of Prob- Series in the Philosophy and History of Science, Pittsburgh, PA: University ability, 27, 1870–1902. of Pittsburgh Press, pp. 351–385.