I am looking for a method (exact, if possible, but at least asymptotically correct) for generating random variates from a Cantor Distribution? It seems like its abstract definition prevents this. In essence, can one "invert" the Cantor Function?
1 Answer
$\begingroup$
$\endgroup$
7
If $B_j$, $j = 1 \ldots \infty$, are independent Bernoulli(1/2) random variables, then $X = 2 \sum_{j=1}^\infty 3^{-j} B_j$ has a Cantor distribution. You could let $U$ be uniform on $[0,1]$ and take $B_j$ to be the $j$'th base-2 digit of $U$ after the "decimal" point.
-
$\begingroup$ Thanks! So practically speaking, I can get arbitrarily good accuracy with this method depending on where I truncate the infinite series? $\endgroup$– user42192Commented Jan 23, 2015 at 5:27
-
$\begingroup$ Yes. Notice that it's not different then getting a U[0,1] (or any other continuous) RV. $\endgroup$ Commented Jan 23, 2015 at 9:13
-
$\begingroup$ Wasn't the question the other way round? However, from a Cantor distribution you can get a Bernoulli sequence which gives you a uniform distribution and hence every distribution on $\mathbb R$. $\endgroup$ Commented Jan 23, 2015 at 9:46
-
$\begingroup$ @JochenWengenroth this method does not generate U[0,1], it generates a value from the cantor distribution. I don't understand your comment. $\endgroup$– user42192Commented Jan 23, 2015 at 10:35
-
1$\begingroup$ You could go either way: given $U$, take its base-2 digits and generate $X$ (which is what I intended), or given $X$, take its base-3 digits and generate $U$. $\endgroup$ Commented Jan 23, 2015 at 15:44