TopKSample: Sampler to generate N top-k lists according to p
Description
Sampler to generate N top-k lists according to p. A function wrapping to a native C implementation is available as well.
Usage
TopKSample(p, N)
TopKSample.c(p, N)
Value
N TopKlists
Arguments
p
Matrix of dimension n*(k+1), n is the number of items (to be ranked) and k is the top elements in the joint ranking. Each column is a multinomial probability vector.
N
The number of samples
Author
Jie Ding <jding@jimmy.harvard.edu>
Details
A pure R implementation TopKSample and a native C method TopKSample.c are available.