Learn R Programming

distributional (version 0.6.0)

dist_exponential: The Exponential Distribution

Description

[Stable]

Exponential distributions are frequently used to model waiting times and the time between events in a Poisson process.

Usage

dist_exponential(rate)

Arguments

rate

vector of rates.

Details

We recommend reading this documentation on pkgdown which renders math nicely. https://pkg.mitchelloharawild.com/distributional/reference/dist_exponential.html

In the following, let \(X\) be an Exponential random variable with parameter rate = \(\lambda\).

Support: \(x \in [0, \infty)\)

Mean: \(\frac{1}{\lambda}\)

Variance: \(\frac{1}{\lambda^2}\)

Probability density function (p.d.f):

$$ f(x) = \lambda e^{-\lambda x} $$

Cumulative distribution function (c.d.f):

$$ F(x) = 1 - e^{-\lambda x} $$

Moment generating function (m.g.f):

$$ E(e^{tX}) = \frac{\lambda}{\lambda - t}, \quad t < \lambda $$

See Also

Examples

Run this code
dist <- dist_exponential(rate = c(2, 1, 2/3))

dist
mean(dist)
variance(dist)
skewness(dist)
kurtosis(dist)

generate(dist, 10)

density(dist, 2)
density(dist, 2, log = TRUE)

cdf(dist, 4)

quantile(dist, 0.7)

Run the code above in your browser using DataLab