MyNixOS website logo
Description

Mittag-Leffler Family of Distributions.

Implements the Mittag-Leffler function, distribution, random variate generation, and estimation. Based on the Laplace-Inversion algorithm by Garrappa, R. (2015) <doi:10.1137/140971191>.

MittagLeffleR

Travis-CI BuildStatus CRAN_Status_Badge Downloads DL_Total

The MittagLeffleR R package

The first type Mittag-Leffler distribution is a heavy-tailed distribution, and occurs mainly as a waiting time distribution in problems with “fractional” time scales, e.g. times between earthquakes.

The second type Mittag-Leffler distribution is light-tailed, and “inverse” to the sum-stable distributions. It typically models the number of events in fractional systems and is used for time-changes of stochastic processes, e.g. anomalous diffusion processes.

Installation

Stable release on CRAN

You can install MittagLeffleR from CRAN via

install.packages("MittagLeffleR")
library(MittagLeffleR)

Development version on Github

Install the devtools package first, then

# install.packages("devtools")
devtools::install_github("strakaps/MittagLeffler")
library(MittagLeffleR)

Usage

See reference manual.

Examples

Fitting a Mittag-Leffler distribution

Generate a dataset first:

library(MittagLeffleR)
y = rml(n = 10000, tail = 0.9, scale = 2)

Fit the distribution:

logMomentEstimator(y, 0.95)
#>      tail     scale    tailLo    tailHi   scaleLo   scaleHi 
#> 0.8998758 2.0170711 0.8995285 0.9002230 2.0151044 2.0190378

Read off

  • the shape parameter (0 < \nu < 1),
  • the scale parameter (\delta > 0),
  • their 95% confidence intervals.

Calculate the probability density of an anomalous diffusion process

Standard Brownian motion with drift (1) has, at time (t), has a normal probability density (n(x|\mu = t, \sigma^2 = t)). A fractional diffusion at time (t) has the time-changed probability density

[p(x,t) = \int n(x| \mu = u, \sigma^2 = u)h(u,t) du]

where (h(u,t)) is a second type Mittag-Leffler probability density with scale (t^\alpha). (We assume (t=1).)

library(ggplot2)
library(tidyr)
tail <- 0.65
dx <- 0.01
x <- seq(-2,5,dx)
t <- 3^(-1:2)
# cut off time so that only 1 % of probability is lost
umax <- qml(p = 0.99, tail = tail, scale = max(t), second.type = TRUE)
u <- seq(0.01,umax,dx)
H <- outer(u,t, function(u,t) {dml(x = u, tail = tail, scale = t^tail)})
N <- outer(x,u,function(x,u){dnorm(x = x, mean = u, sd = sqrt(u))})
p <- N %*% H * dx
df <- data.frame(p)
names(df) <- sapply(t, function(t){paste0("T=",round(t,2))})
df['x'] <- x
df %>% 
  gather(key = "time", value = "density", -x) %>%
  ggplot(mapping = aes(x=x, y=density, col=time)) + 
  geom_line() + 
  labs(ggtitle("Subdiffusion with drift"))

Vignettes

See the page strakaps.github.io/MittagLeffleR/articles/ for vignettes on

  • Plots of the Mittag-Leffler distributions
  • Details of Mittag-Leffler random variate generation
  • Probabilities and Quantiles.
Metadata

Version

0.4.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows