For the efficient generation of random variates, we use the following useful fact (see e.g. Theorem 19.1 in @Haubold2011a): A standard \(\alpha\)-Mittag-Leffler random variable \(Y\) has the representation:
\[Y \stackrel{d}{=} X^{1/\alpha} Z\]
where \(X\) is standard exponentially distributed, \(Z\) is \(\alpha\)-stable with Laplace Transform \(\mathbf E[\exp(-sZ)] = \exp(-s^\alpha)\), \(X\) and \(Z\) are independent, and \(\stackrel{d}{=}\) means equality in distribution. We use the parametrization of the stable distribution by @SamorodnitskyTaqqu as it has become standard. For \(\alpha \in (0,1)\) and \(\alpha \in (1,2)\),
$$\mathbf E[\exp(it Z)] = \exp\left\lbrace -\sigma\alpha |t|\alpha \left[1 - i \beta {\rm sgn}t \tan \frac{\pi \alpha}{2}\right]
As in @thebook, Equation (7.28), set
\[\sigma^\alpha = C \Gamma(1-\alpha) \cos \frac{\pi\alpha}{2},\]
for some constant \(C > 0\), set \(\beta = 1\), set \(a = 0\), and the log-characteristic function becomes
\begin{align} -C \frac{\Gamma(2-\alpha)}{1-\alpha} \cos \frac{\pi\alpha}{2} |t|\alpha \left[1 - i\, {\rm sgn}(t) \tan \frac{\pi \alpha}{2}\right] \ = -C \Gamma(1-\alpha)|t|\alpha \left[ \cos \frac{\pi \alpha}{2}
Setting \(t = is\) recovers the Laplace transform, and to match the Laplace transform \(\exp(-s^\alpha)\) of \(Z\), it is necessary that \(C \Gamma(1-\alpha) = 1\). But then \(\sigma^\alpha = \cos(\pi \alpha/2)\), and we see that
\[Y \sim S(\alpha, \beta, \sigma, a) = S(\alpha, 1, \cos(\pi\alpha/2)^{1/\alpha}, 0)\]
To generate such random variates \(Z\), use e.g.
a <- 0.8
n = 5
sigma <- (cos(pi*a/2))^(1/a)
z <- stabledist::rstable(n = n, alpha = a, beta = 1, gamma = sigma, delta = 0, pm = 1)
and to generate \(Y\),
x <- rexp(n)
y <- x^(1/a) * z
y
## [1] 0.20365884 1.71044779 803.19782916 0.09992026 1.28107727