* @param numWords int number of words in the vocabulary
* @param numWords E[count] for each word
*/
private RandomAccessSparseVector generateRandomDoc(int numWords, double sparsity) throws MathException {
RandomAccessSparseVector v = new RandomAccessSparseVector(numWords,(int)(numWords * sparsity));
IntegerDistribution dist = new PoissonDistributionImpl(sparsity);
for (int i = 0; i < numWords; i++) {
// random integer
v.set(i,dist.inverseCumulativeProbability(random.nextDouble()) + 1);
}
return v;
}