zbobet2012
- 14
- 0
The only reliable method of generating random numbers according to a Zipf distribution I have been able to find was here:
http://books.google.com/books?id=ER...AEwBw#v=onepage&q=inverse CDF of zipf&f=false
but this does not work for parameters of alpha < 1. My first instinct is to generate an array a such that a_{i} represents the CDF at that point, than generate a RV U~Uniform and check it against each bin to see if it is less than that item. (E.g. if P(1)=0.5, P(2)=0.25, P(3)=.125 than a_{1}=0.5, a_{2}=0.75, a_{3}=0.875 and U_{1}=0.4, U_{2}=0.55, U_{3}=0.9 than we return 1 when we generate U_{1} and 2 for U_{2} etc. Will this generate a correct distribution?
http://books.google.com/books?id=ER...AEwBw#v=onepage&q=inverse CDF of zipf&f=false
but this does not work for parameters of alpha < 1. My first instinct is to generate an array a such that a_{i} represents the CDF at that point, than generate a RV U~Uniform and check it against each bin to see if it is less than that item. (E.g. if P(1)=0.5, P(2)=0.25, P(3)=.125 than a_{1}=0.5, a_{2}=0.75, a_{3}=0.875 and U_{1}=0.4, U_{2}=0.55, U_{3}=0.9 than we return 1 when we generate U_{1} and 2 for U_{2} etc. Will this generate a correct distribution?