vervaatsim returns a Vervaat perpetuity.
This function allows to simulate exactly from a Vervaat perpetuity distribution with parameter $\beta \in (0,+\infty)$. The simulation method, by K. Cloud, M. Huber (2018), is accurate and very efficient: it is $\mathcal{O}(\beta \log(\beta))$, in the sense that it uses $T$ uniform random variates, where $\mathbf{E}[T] \le \mathcal{O}(\beta \log(\beta))$. Therefore the algorithm is good even for $\beta \gg 1$.
Remark: this function is recursive and cannot be easily extended to the generation of several vervaat numbers.
The FSDA code has been translated from the R version of the authors.
Below we give briefly some definitions, background and motivations. In the references, we also include several key works on the distribution.
Cloud, K. and Huber, M. (2018), Fast Perfect Simulation of Vervaat Perpetuities, "Journal of Complexity", Vol. 42, pp. 19-30.
Devroye, L. (2001), Simulating perpetuities, "Methodology And Computing In Applied Probability", Vol. 3, Num. 1, pp. 97–115.
Fill, J. A. and Huber, M. (2010), Perfect simulation of Vervaat perpetuities, "Electronic Journal of Probability", Vol. 15, pp. 96–109.
Devroye, L. and Fawzi, O. (2010), Simulating the Dickman distribution, "Statistics and Probability Letters", Vol. 80, pp. 242–247.
Blanchet, J. H. and Sigman, K. (2011), On exact sampling of stochastic perpetuities, "Journal of Applied Probability", Vol. 48A, pp. 165–182.
Takacs, L. (1955), On stochastic processes connected with certain physical recording apparatuses. "Acta Mathematica Academiae Scientificarum Hungarica", Vol. 6, pp 363-379.
Barabesi, L. and Pratelli, L. (2019), On the properties of a Takacs distribution, "Statistics and Probability Letters", Vol. 148, pp. 66-73.