rcantor: Fast Simulation of Cantor Random Variables

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/rcantor.R

Description

The function generates uniformly random variable on the Cantor set. The distribution provided is singular (neither dsicrite nor absolutely continuous nor a mixture).

Usage

1

Arguments

n

integer, number of simulations.

Details

The Cantor set is uncountable with Lebesgue's measure 0 which leads to a singular probability distribution. The corresponding cumulative probability distribution is the Devil's staircase. The cantor set can be viewed as the number of the form sum(j=1, +Inf) c_j / 3^j with c_j in {0, 2} and the corresping probability distribution simulates uniformely the c_j (here, to j=32).

Value

A vector of i.i.d. Cantor random variables.

Note

This distribution is provided only for theorical use, not practical.

Author(s)

Nicolas Baradel - PGM Solutions

References

https://en.wikipedia.org/wiki/Cantor_distribution

See Also

http://pgm-solutions.com/packages

Examples

1

Example output

[1] 0.003691901 0.971204712 0.999860616 0.988911421 0.299969752

rpgm documentation built on March 18, 2018, 2:24 p.m.