The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
Set parameters:
library(MittagLeffleR)
<- 0.7
tail <- 2
scale <- 1000
n <- 2 * scale cutoff
Generate 1000 i.i.d. random variables, and plot their empirical CDF (black) against the population CDF (red). The curved dashed line represents the stretched exponential function, due to the asymptotic result
\[f(x; \alpha, \tau) \sim \exp(-(x/\tau)^\alpha), \quad x \downarrow 0.\]
The straight dashed line in the second plot represents the function \(x^{-\alpha}\), showing asymptotic equivalence to a power-law for large values.
<- rml(n = n, tail = tail, scale=scale)
r <- ecdf(r)
edfun <- seq(0.01,10,0.01)
x plot(x,edfun(x), xlim=c(0,10), type='l', main = "CDF on linear scale",
ylab="p", xlab="x")
<- pml(q = x, tail = tail, scale=scale)
y lines(x,y,col=2)
<- 1-exp(-(x/scale)^tail)
z lines(x,z, lty=2)
<- exp(seq(-10,10,0.01))
x <- 1-edfun(x)
y plot(x,y, type='l', log='xy', main = "Tail Function on log-scale",
xlab = "x", ylab = "p")
<- pml(q = x, tail = tail, scale=scale, lower.tail = FALSE)
y lines(x,y, col=2)
# power law for large values
<- x^(-tail)
z lines(x,z, lty=2)
# stretched exponential for small values
<- exp(-(x/scale)^tail)
w lines(x,w, lty=2)
A plot of the density:
<- 10
cutoff <- sum(r <= cutoff) / n
fac <- r[r <= cutoff]
r hist(r, freq = FALSE, breaks = 50)
<- seq(0.01,cutoff,0.01)
x <- dml(x = x, tail = tail, scale=scale) / fac
y lines(x,y, col=2)
The second type of Mittag-Leffler distribution is light-tailed, and in fact has finite moments of all orders: it drops off faster than the exponential distribution (dashed line).
library(MittagLeffleR)
<- 10^5
n <- 0.6
tail <- rml(n = n, tail = tail, scale=scale, second.type = TRUE)
r <- ecdf(r)
edfun plot(edfun, xlim=c(0,cutoff))
<- seq(0.01,cutoff,0.01)
x <- pml(q = x, tail = tail, scale=scale, second.type = TRUE)
y lines(x,y, col=2)
<- exp(seq(-10,4,0.01))
x <- 1-edfun(x)
y plot(x,y, type='l', log='xy', main = "Tail Function on log-scale",
xlab = "x", ylab = "p")
<- pml(q = x, tail = tail, scale=scale, lower.tail = FALSE, second.type = TRUE)
y lines(x,y, col=2)
# exponential distribution
<- exp(-(x/scale))
w lines(x,w, lty=2)
A plot of the density:
hist(r, freq = FALSE, breaks = 20)
<- seq(0.01,cutoff,0.01)
x <- dml(x = x, tail = tail, scale=scale, second.type = TRUE)
y lines(x,y, col=2)
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.