- #1
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 [tex]a[/tex] such that [tex]a_{i}[/tex] represents the CDF at that point, than generate a RV [tex]U[/tex]~Uniform and check it against each bin to see if it is less than that item. (E.g. if [tex]P(1)=0.5, P(2)=0.25, P(3)=.125[/tex] than [tex]a_{1}=0.5, a_{2}=0.75, a_{3}=0.875[/tex] and [tex]U_{1}=0.4, U_{2}=0.55, U_{3}=0.9[/tex] than we return 1 when we generate [tex]U_{1}[/tex] and 2 for [tex]U_{2}[/tex] 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 [tex]a[/tex] such that [tex]a_{i}[/tex] represents the CDF at that point, than generate a RV [tex]U[/tex]~Uniform and check it against each bin to see if it is less than that item. (E.g. if [tex]P(1)=0.5, P(2)=0.25, P(3)=.125[/tex] than [tex]a_{1}=0.5, a_{2}=0.75, a_{3}=0.875[/tex] and [tex]U_{1}=0.4, U_{2}=0.55, U_{3}=0.9[/tex] than we return 1 when we generate [tex]U_{1}[/tex] and 2 for [tex]U_{2}[/tex] etc. Will this generate a correct distribution?