Power-law random generator
Posted: June 2, 2008 Filed under: Uncategorized Leave a comment »So you want to generate random numbers distributed along a power-law, uh?
Suppose your target distribution is:
you will use:
where x is a random variable distributed uniformly and n>1.
This formula comes from the differential equality:
which becomes:
in case x is distributed uniformly. For example, suppose you want to generate numbers which are distributed exponentially, you will use:
which finally gives:
Advertisement