Has someone run across a method for generating random variates from a Cantor Distribution? It seems like its abstract definition prevents this. In essence, can one "invert" the Cantor Function?
Asked
Active
Viewed 828 times
1 Answers
9
One way of looking at a random variable with a Cantor distribution is to start with a sequence of iid random variables $X_n$ that take values 0 and one with probability $\frac{1}{2}$ (think random bits, or fair coins). Then our Cantor random variable is $$Z=2 \sum_{n=1}^\infty \frac{X_n}{3^n}.$$ A particularly nice source of independent random bits is the bits in a uniform (0,1) random variable.
Of course, given finite time you only get finite precision, but the same is true of standard simulated random numbers. Since the cantor distribution is continuous, you can get as close as you need to.
deinst
- 5,596
- 26
- 31
-
+1. But actually, the standard Cantor random variable is twice the Z you wrote. – Did Jan 01 '16 at 23:15
-
4+1. A software implementation of this solution appears at http://stats.stackexchange.com/questions/229556. – whuber Aug 12 '16 at 15:41