Bayesian nonparametric models for ranked data
Francois Caron, Yee Whye Teh
Introduction
Data in the form of partial rankings, i.e. in terms of an ordered list of the top- items, arise in many contexts. For example, in this paper we consider datasets consisting of the top 20 bestselling books as published each week by the New York Times. The Plackett-Luce model is a popular model for modeling such partial rankings of a finite collection of items. It has found many applications, including choice modeling , sport ranking , and voting . [6, Chap. 9] provides detailed discussions on the statistical foundations of this model.
In the Plackett-Luce model, each item is assigned a positive rating parameter , which represents the desirability or rating of a product in the case of choice modeling, or the skill of a player in sport rankings. The Plackett-Luce model assumes the following generative story for a top- list of items : At each stage , an item is chosen to be the th item in the list from among the items that have not yet appeared, with the probability that is selected being proportional to its desirability . The overall probability of a given partial ranking is then:
with the denominator in (1) being the sum over all items not yet selected at stage .
In many situations the collection of available items can be very large and potentially unknown. In this case, a nonparametric approach can be sensible, where the pool of items is assumed to be infinite and the model allows for the possibility of items not observed in previous top- lists to appear in new ones. In this paper we propose such a Bayesian nonparametric Plackett-Luce model. Our approach is built upon recent work on Bayesian inference for the (finite) Plackett-Luce model and its extensions . Our model assumes the existence of an infinite pool of items , each with its own rating parameter, . The probability of a top- list of items, say , is then a direct extension of the finite case (1):
To formalize the framework, a natural representation to encapsulate the pool of items along with their ratings is using an atomic measure:
Using this representation, note that the top item in our list is simply a draw from the probability measure obtained by normalizing , while subsequent items in the top- list are draws from probability measures obtained by first removing from the atoms corresponding to previously picked items and normalizing. Described this way, it is clear that the Plackett-Luce model is basically a partial size-biased permutation of the atoms in , and the existing machinery of random measures and exchangeable random partitions can be brought to bear on our problem.
In particular, in Section 2 we will use a gamma process as the prior over the atomic measure . This is a completely random measure with gamma marginals, such that the corresponding normalized probability measure is a Dirichlet process. We will show that with the introduction of a suitable set of auxiliary variables, we can characterize the posterior law of given observations of top- lists distributed according to (2). A simple Gibbs sampler can then be derived to simulate from the posterior distribution. In Section 3 we develop a time-varying extension of our model and derive a simple and effective Gibbs sampler for posterior simulation. In Section 4 we apply our time-varying Bayesian nonparametric Plackett- Luce model to the aforementioned New York Times bestsellers datasets, and conclude in Section 5.
A Bayesian nonparametric model for partial ranking
A nonparametric Plackett-Luce model can now be easily derived by taking the limit as the number of choice items . For those items that have appeared among the observed partial rankings, the limiting conditional distribution (5) is well defined since . For items that did not appear in the observations, (5) becomes degenerate at 0. Instead we can define to be the total desirability among all infinitely many previously unobserved items, and show that
2 A Bayesian nonparametric Plackett-Luce model
The above construction is depicted on Figure 1(left). We visualize on right some top- lists generated from the model, with and different values of .
3 Posterior characterization
The joint probability of the item lists and auxiliary variables is then (c.f. (7)):
Taking expectation of (13) with respect to using the Palm formula gives:
The marginal probability of the partial rankings and auxiliary variables is:
where is the Laplace transform of ,
and is the th moment of the exponentially tilted Lévy intensity :
Details are given in the appendix. Another application of the Palm formula now allows us to derive a posterior characterisation of :
where and are mutually independent. The law of is still a gamma process,
4 Gibbs sampling
Note that this update was derived with marginalized out, so after an update to it is necessary to immediately update via (22) before proceeding to update other variables.
Dynamic Bayesian nonparametric ranking models
In this section we develop an extension of the Bayesian nonparametric Plackett-Luce model to model time-varying rankings, where the rating parameters of items may change smoothly over time and reflected in a changing series of rankings. Given a series of times indexed by , we may model the rankings at time using a gamma process distributed random measure as in Section 2.2, with Markov dependence among the sequence of measures enabling dependence among the rankings over time.
We will construct a dependent sequence which marginally follow a gamma process using the construction of . Suppose . Since is atomic, we can write it in the form:
Define a random measure with conditional law:
where is a dependence parameter. Using the same method as in Section 2.3, we can show:
Suppose the law of is . The conditional law of given is then:
where and are all mutually independent. The law of is given by a gamma process, while the masses are conditionally gamma,
The idea of is to define the conditional law of given and to coincide with the conditional law of given as in Proposition 3. In other words, define
where and are mutually independent. If the prior law of is , the marginal law of will be as well when both and are marginalized out, thus maintaining a form of stationarity. Further, although we have described the process in order of increasing , the joint law of can equivalently be described in the reverse order with the same conditional laws as above. Note that if , the conditional distribution of will be degenerate at 0. Hence has an atom at if and only if has an atom at , that is, if . In addition, it also has atoms (those in ) where does not (nor does ). Finally, the parameter can be interpreted as controlling the strength of dependence between and . Indeed it can be shown that
Another measure of dependence can be gleaned by examining the “lifetime” of an atom. Suppose is an atom in with mass . The probability that is an atom in with positive mass is , in which case it has positive mass in as well. Conversely, once it is not an atom, it will never be an atom in the future since the base distribution is non-atomic. The lifetime of the atom is then the smallest such that it is no longer an atom. We can show by induction that: (details in appendix)
The probability that an atom in with mass is dead at time is given by
where can be obtained by the recurrence and .
2 Posterior characterization and Gibbs sampling
Assume for simplicity that at each time step we observe one top- list (it trivially extends to multiple partial rankings of differing sizes). We extend the results of the previous section in characterizing the posterior and developing a Gibbs sampler for the dynamical model.
3 Continuous time formulation using superprocesses
with parametrizing the rate of evolution. Figure 2 gives a sample path, where we see that it is continuous but non-differentiable.
For efficient inference, it is desirable to be able to integrate out all ’s except those at observation times. An advantage to using the Dawson-Watanabe superprocess is that, the conditional distribution of given is remarkably simple . In particular it is simply given by the discrete-time process of the previous section with dependence parameter Thus the inference algorithm developed previously is directly applicable to the continuous-time model too.
Experiments
We apply the discrete-time dynamic Plackett-Luce model to the New York Times bestsellers data. These consist of the weekly top-20 best-sellers list from June 2008 to April 2012 in various categories. We consider here the categories paperback nonfiction (PN) and hardcover fiction (HF), for which respectively 249 and 916 books appear at least once in the top-20 lists over the 200 weeks. We consider that the correlation parameter is constant over time, and assign flat improper priors and . In order to take into account the publication date of a book, we do not consider books in the likelihood before their first appearance in a list. We run the Gibbs sampler with 10000 burn-in iterations followed by 10000 samples. Mean normalized weights for the more popular books in both categories are shown in Figure 3.
The model is able to estimate the weights associated to each book that appeared at least once, as well as the total weight associated to all other books, i.e. the probability that a new book enters at the first rank in the list, represented by the black curve. Moreover, the Bayesian approach enables us to have a measure of the uncertainty on the weights. The hardcover fiction category is characterized by rapid changes in successive lists, compared to the paperback nonfiction. This is quantified by the estimated value of the parameter , which are respectively and for PN and HF. The estimated values of the shape parameter are and respectively.
Discussion
We have proposed a Bayesian nonparametric Plackett-Luce model for ranked data. Our approach is based on the theory of atomic random measures, where we showed that the Plackett-Luce generative model corresponds exactly to a size-biased permutation of the atoms in the random measure. We characterized the posterior distribution, and derived a simple MCMC sampling algorithm for posterior simulation. Our approach can be see as a multi-stage generalization of posterior inference in normalized random measures , and can be easily extended from gamma processes to general completely random measures.
We also proposed dynamical extensions of our model for both discrete and continuous time data, and applied it to modeling the bestsellers’ lists on the New York Times. Our dynamic extension may be useful for modeling time varying densities or clusterings as well. In our experiments we found that our model is insufficient to capture the empirical observation that bestsellers often start off high on the lists and tail off afterwards, since our model has continuous sample paths. We adjusted for this by simply not including books in the model prior to their publication date. It may be possible to model this better using models with discontinuous sample paths, for example, the Orstein-Uhlenbeck approach of where the process evolves via a series of discrete jump events instead of continuously.
Acknowledgements
YWT thanks the Gatsby Charitable Foundation for generous funding.
References
Appendix A Proof of Theorem 1
The marginal probability (14) is obtained by taking the expectation of (13) with respect to . Note however that (13) is a density, so to be totally precise here we need to work with the probability of infinitesimal neighborhoods around the observations instead, which introduces significant notational complexity. To keep the notation simple, we will work with densities, leaving it to the careful reader to verify that the calculations indeed carry over to the case of probabilities.
Appendix B Proof of Theorem 2
The proof is essentially obtained by calculating the numerator and denominator of (32). The denominator is already given in Theorem 1. The numerator is obtained using the same technique with the inclusion of the term , which gives:
Dividing the numerator (31) by the denominator (33), the characteristic functional of the posterior is:
Appendix C Proof of Proposition 4
Appendix D Gibbs sampler for the dynamic nonparametric Plackett-Luce model
For ease of presentation, we assume that takes the same value at each time step. The Gibbs sampler will iterate between the following steps
b. For , update given
Update given
Update given
For , update ( given
For , update given
Update given
1.b) Sample given (
Consider first the sampling of . We have, for and
Hence we can have the following MH update. If , then we necessarily have . We sample zPoisson where zPoisson denotes the zero-truncated Poisson distribution and accept w.p.
If , we only have two possible moves: or , given by the following probabilities
Note that the above Markov chain is not irreducible, as the probability is zero to go from a state to a state , even though the posterior probability of this event is non zero in the case item does not appear after time . We can resolve that by the following procedure, that uses a backward forward recursion.
Assume that item does not appear after time step (the same procedure applies if item does not appear before time step ). Then we can sample jointly the whole sequence using the following backward forward recursion.
We have, for and
We can sample from the full conditional which is given by
where and are obtained with the following recursion
2.b) Sample given
We can sample from the full conditional which is given by
where is defined above. Then for , let
3) Sample given
if , otherwise, set The occurence indicator is defined as
For and , sample
5) Sample given
We sample using a MH step. Propose where and . And accept it with probability