For most of the classical distributions, base R provides
probability distribution functions (p), density functions (d), quantile functions
(q), and random number generation (r).
Beyond this basic functionality, many CRAN packages provide
additional useful distributions. In particular, multivariate distributions as well as copulas
are available in contributed packages.
Ultimate bibles on probability distributions are
-
Continuous univariate distributions by N. L. Johnson, S. Kotz and N. Balakrishnan,
-
Thesaurus of univariate discrete probability distributions by G. Wimmer and G. Altmann.
The maintainer greatfully acknowledged Achim Zeileis, David Lüthi, Tobias Verbeke, Robin
Hankin, Mathias Kohl, G. Jay Kerns for their useful comments/suggestions.
If you think information is not accurate
or not complete, please let me know.
Base functionality:
-
Base R provides probability distribution functions
p
foo
()
density functions
d
foo
(), quantile functions
q
foo
(), and random number generation
r
foo
()
where
foo
indicates the type
of distribution:
beta (
foo
=
beta),
binomial
binom,
Cauchy
cauchy,
chi-squared
chisq,
exponential
exp,
Fisher F
f,
gamma
gamma,
geometric
geom,
hypergeometric
hyper,
logistic
logis,
lognormal
lnorm,
negative binomial
nbinom,
normal
norm,
Poisson
pois,
Student t
t,
uniform
unif,
Weibull
weibull.
Following the same naming scheme, but somewhat less standard are the following distributions
in base R: probabilities of coincidences (also known as "birthday paradox")
birthday
(only p and q), studentized range distribution
tukey
(only p and q), Wilcoxon signed rank distribution
signrank, Wilcoxon
rank sum distribution
wilcox.
-
On base R distributions,
prob
provides the characteristic function, while
actuar
implements moments, limited expected values and moment generating
function.
Discrete distributions:
-
Basic distributions
: The binomial distribution (in particular
Bernoulli distribution) is already implemented in base R.
The discrete uniform
distribution can be easily obtained with the basic functions.
Dirac distribution is provided by
distr. Truncated versions of
the binomial and Poisson distributions as well as zero-inflated
versions of the binomial, Poisson and negative binomial distributions
are implemented in
VGAM.
-
Conway-Maxwell-Poisson distribution
: This can be found in
compoisson.
-
Hypergeometric distributions
: Extented hypergeometric distribution
can be found in
BiasedUrn
package, which provides
not only p, d, q, r functions but also mean, variance, mode functions.
-
Triangle distribution
: The discrete triangle distribution can be found in
TRIANG.
-
Zipf law
: Package
zipfR
provides tools for the Zipf and
the Zipf-Mandelbrot distributions.
VGAM
also implements the Zipf distribution.
-
Further distributions
: The
VGAM
package provides several
additional distributions, namely: Logarithmic,
Skellam, Yule-Simon, Zeta and Haight's Zeta, Borel-Tanner and
Felix distribution.
Continuous distributions:
-
Arcsine distribution
: implemented in package
distr.
-
Beta distribution and its extensions
: Base R provides
the d, p, q, r functions for this distribution (see above).
actuar
provides moments and limited expected values.
It also provide the d, p, q, r functions for the generalized beta and
the inverse tranformed beta distribution. The
beta of the second kind and the generalized beta distribution
can be found in
VGAM. Several special cases of
the generalized beta distribution are also implemented in
VGAM:
Lomax, inverse Lomax, Dagum, Fisk (aka log logistic), (inverse or not)
paralogistic and Singh-Maddala distribution.
-
Benini distribution
: Provided in
VGAM.
-
Birnbaum-Saunders distribution
: Provided in packages
bs
and
VGAM. The generalized Birnbaum-Saunders distribution is implemented in
gbs.
-
Cardioid distribution
: Provided in
VGAM.
-
Cauchy distribution
: Base R provides
the d, p, q, r functions for this distribution (see above). Another
implementation is available in
lmomco.
-
Chi(-squared or not) distributions
: Base R provides
the d, p, q, r functions for this distribution (see above). Moments, limited
expected values and the moment generating function are provided by
actuar.
Only d,r functions are available for the inverse chi-squared distribution
by package
geoR. The Chi
distribution and the non-central Chi distribution are not yet implemented.
-
Davies distribution
: The Davies distribution is provided
in
Davies
package.
-
Dirichlet distribution
: functions d, r
are provided in
MCMCpack
and
bayesm.
-
Exponential distribution and its extensions
: Base R provides the d, p, q, r functions
for this distribution (see above).
actuar
provides additional functions
such as the moment generating function, moments and limited expected values. It also has
the d, p, q, r for the inverse exponential distribution. The shifted exponential distribution
is implemented in
lmomco
package with d, p, q, r functions.
-
Frechet distribution
: Provided in
VGAM
and
evd.
-
Gamma distribution and its extensions
: Base R provides
the d, p, q, r functions for this distribution (see above).
actuar
provides d, p, q, r functions for the inverse, the inverse
transformed and the log gamma distributions
while
ghyp
provides those functions for the variance gamma distribution.
VGAM
provides d, p, q, r functions of the log
gamma and the generalized gamma distribution.
-
Gaussian (or normal) distribution and its extensions
: Base R provides
the d, p, q, r functions for this distribution (see above).
actuar
provides the moment generating function and moments.
ghyp
package
provides d, p, q, r functions for the raw and the generalized inverse gaussian distribution, in the
context of the generalized hyperbolic distribution.
SuppDists
provides functions for the inverse Gaussian distribution as well and furthermore includes functions
for computing moments, skewness, kurtosis.
VGAM
also implements
the folded and the skewed normal distribution, the inverse gaussian distribution.
lmomco
implements
the generalized normal distribution. The log normal distribution is implemented
in Base R (see above).
Finally, the multivariate Gaussian distribution
is provided by the packages
mvtnorm
and
mnormt, while
mvtnormpcs
implements multivariate student/normal integrals,
given a correlation matrix structure.
-
General Error Distribution (also known as exponential power distribution)
:
provided in
normalp.
-
Generalized Extreme Value distribution
: Provided in
lmomco
(d, p, q) ,
VGAM
and
evd
(d, p, q, r). Both bivariate and
multivariate Extreme Value distributions as well as order/maxima/minima distributions
are implemented in
evd
(d, p, r).
-
Gumbel distribution
: Provided in packages
lmomco,
VGAM
and
evd. The reverse Gumbel distribution is implemented
in
lmomco.
-
Kappa distribution
: Provided in
lmomco.
-
Kumaraswamy distribution
: Provided in package
VGAM.
-
Lambda distribution
: The Tukey lambda (also known as the generalized
lambda) distribution is implemented in packages
gld
and
Davies.
-
Laplace and asymetric Laplace distribution
: Provided in
VGAM.
Laplace distribution (also called double exponential distribution) is implemented in
distr.
-
Logistic distributions and its extensions
: Base R provides
the d, p, q, r functions for this distribution (see above).
actuar
provides d, p, q, r functions for
the log logistic (also called Fisk), the paralogistic and the inverse paralogistic distributions.
VGAM
package also implements these distributions plus
the bivariate logistic distribution.
lmomco
implements the generalized logistic distribution.
-
Maxwell distribution
: Provided in
VGAM.
-
Nakagami distribution
: Provided in
VGAM.
-
Pareto distribution
: d, p, q, r functions are implemented in
VGAM
for the Pareto distribution type IV (which includes Burr's distribution,
Pareto type III, Pareto type II (also called the Generalized Pareto Distribution - GPD) and
Pareto type I) and the (upper/lower) truncated Pareto distribution. In an actuarial
context,
actuar
provides d, p, q, r functions as well as moments and
limited expected values for the Pareto, the inverse Pareto, the 'generalized pareto'
distributions, the Burr and the inverse Burr distributions.
Finally
lmomco,
POT
and
evd
packages
implement the GPD.
-
Pearson type III distribution
: Available in
lmomco.
-
Phase-type distributions
: Provided in
actuar.
-
Rayleigh distribution
: Provided in packages
VGAM
and
lmomco.
-
Rice distribution
: Provided in
VGAM.
-
Slash distribution
: Provided in
VGAM.
-
stable distributions
: d, p, q, r functions are available in
fBasics,
the functions use the approach of J.P. Nolan for general stable distributions.
-
Student distribution and its extensions
: Base R provides
the d, p, q, r functions for Student and non central Student distribution (see above).
The skewed Student distribution is provided by
skewt
and
sn
packages. Package
tdist
provides d, p, q functions
for the distribution of a linear combination of independent Student distributions.
The multivariate Student distribution
is provided by the packages
mvtnorm
and
mnormt.
-
Triangle distribution
: Provided in packages
triangle
and
VGAM.
-
Tweedie distribution
: the Tweedie distribution is implemented
in package
tweedie. Let us note that the Tweedie distribution
is not necessarily continuous, a special case of it is the Poisson distribution.
-
Uniform distribution
: d, p, q, r functions are of course provided
in R. See section RNG for random number generation topics.
-
Wakeby distribution
: Provided in
lmomco.
-
Weibull distribution and its extensions
: Base R provides
the d, p, q, r functions for this distribution (see above).
The inverse Weibull is provided by
actuar
package and also the moments
and the limited expevted value for both the raw and the inverse Weibull distribution.
Finally,
lmomco
implements the Weibull distribution while
evd
implements the reverse Weibull distribution.
-
Wishart and inverse Wishart distributions
: functions d, r
are provided in
MCMCpack
and
bayesm.
Mixture of probability laws:
-
Gaussian mixture
: Functions d, r are provided by
mixtools
package when dealing with finite mixture models.
-
Gamma mixture
: Gamma shape mixtures are implemented (d, p, r)
in the
GSM
package.
-
Generic mixtures
: there is an implementation via S4-class
UnivarMixingDistribution in package
distr.
-
Student mixture
: The
AdMit
package provides d, r functions
for Student mixtures in the context of Adaptive Mixture of Student-t distributions.
Copulas:
-
Unified approaches
:
The packages
fCopulae,
copula
provide a lot of general functionality for copulas.
-
Archimedean copulas
: The Frank bivariate distribution
is available in
VGAM.
fCopulae
implements the 22 Archimedean
copulas of Nelsen (1998,
Introduction to Copulas
, Springer-Verlag) including
Gumbel, Frank, Clayton, and Ali-Mikhail-Haq.
gumbel
is a
standalone package for the Gumbel copula and
VGAM
provides the Ali-Mikhail-Haq bivariate distribution. Generalized Archimedean copulas
are implemented in the
fgac
package.
-
Cubic copula
: Not yet implemented
-
Dirichlet copula
: Not yet implemented
-
Elliptical copulas
: Gaussian, Student and Cauchy copulas are implemented in
fCopulae
for the bivariate cases.
copula
provides the Gaussian
and the Student copula.
-
Extreme value copulas
:
fCopulae
provides the following copulas
Gumbel, Galambos, Husler-Reiss, Tawn, or BB5.
copula
also implements
Gumbel, Galambos and Husler-Reiss.
BLCOP
presents an application of
the copula-opinion pooling framework.
-
Eyraud-Farlie-Gumbel-Morgenstern
: Provided in
VGAM
and
copula.
-
Mardia copula
: Not yet implemented
-
Plackett
: Provided in
VGAM
and
copula.
Random Number Generators:
-
Basic functionality: R provides several random number generators (RNGs).
The random seed can be provided via
set.seed
and the kind of RNG can be specified
using
RNGkind. The default RNG is the Mersenne-Twister algorithm.
Other generators include Wichmann-Hill, Marsaglia-Multicarry, Super-Duper,
Knuth-TAOCP, Knuth-TAOCP-2002, as well as user-supplied RNGs. For normal
random numbers, the following algorithms are available: Kinderman-Ramage,
Ahrens-Dieter, Box-Muller, Inversion (default).
-
Setting the RNG:
In addition to the tools above,
setRNG
provides an easy way to set,
retain information about the setting, and reset the RNG.
-
Pseudo-randomness
:
RDieHarder
offers several dozen new RNGs
from the GNU GSL and
randtoolbox
provides
more recent RNGs such as WELL and SF Mersenne-Twister.
rsprng
implements Scalable Parallel RNGs library, whereas
randaes
provides the deterministic part of the Fortuna cryptographic
pseudorandom number generator (AES). Furthermore,
rstream
focuses on multiple
independent streams of random numbers from different sources (in a object oriented
approach). For non-uniform generation, the
Runuran
package
interfaces to the UNU.RAN library for universal non-uniform RNGs, while the
rv
package provides a class to easily manipulate and summarize
simulations in R.
-
Quasi-randomness
: The
randtoolbox
provides
the following quasi random sequences: the Sobol sequence, the Halton
(hence Van Der Corput) sequence and the Torus sequence (also known as Kronecker
sequence).
lhs
package implements the latin hypercube sampling,
an hybrid quasi/pseudo random method.
-
True randomness
: The
random
package provides several functions that access the
true random number service at
random.org
.
-
RNG tests
:
RDieHarder
offers
numerous tests of RNGs based on a
reimplementation and extension of Marsaglia's DieHarder battery.
randtoolbox
provides basic RNG tests.
-
Parallel computing
: For parallel computing with random numbers, see the
HighPerformanceComputing
task view.
Miscellaneous:
-
Hierarchical models
: Distributions whose some parameters
are no longer constant but random according to a particular distribution.
VGAM
provides a lot of hierarchical models: beta/binomial,
beta/geometric and beta/normal distributions.
bayesm
implements: binary logit, linear, multivariate logit and negative binomial
models. Furthermore
LearnBayes
and
MCMCpack
provides poisson/gamma, beta/binomial,
normal/normal and multinomial/Dirichlet models.
-
Transformation
: Lebesgue decomposition are implemented
in
distr, as well as Convolution, Truncation and Huberization of distributions.
Furthermore,
distr
provides distribution of the maximum or minimum
of two distributions. See Object-orientation below.
-
Object-orientation
:
General discrete and continuous distributions are implemented in package
distr
respectively via S4-class DiscreteDistribution and
AbscontDistribution providing the classic d, p, q and r functions.
distrEx
extends available distributions to multivariate and conditional distributions as well
as methods to compute useful statistics (expectation, variance,...) and distances
between distributions (Hellinger, Kolmogorov,... distance). Finally
package
distrMod
provides functions for the computation of minimum
criterion estimators (maximum likelihood and minimum distance estimators). See other
packages of the distr-family (distrSim,
distrTEst,
distrTeach,
distrDoc).
-
TI 83 scientific calculator
:
distributions
provides
the base R probability distributions (binomial, poisson, geometric,
normal, chi square, Fisher, Student)
based on TI-83 Plus graphic scientific calculator.
-
Transversal functions
: Package
modeest
provides mode
estimation for various distributions, while
lmomco
focuses on
moments estimation.
VGAM
provides a lot of parameter
estimation for usual and "exotic" distributions. Package
MASS (in the
VR
bundle) implements the flexible
fitdistr
function for parameter estimations.
Bivariate copulas can be fitted with
mlCopulaSelection.