Create a Exponential distribution

Exponential(rate = 1)

Arguments

rate

The rate parameter. Can be any positive number. Defaults to 1.

Value

A Exponential object.

See also

Examples

set.seed(27) X <- Exponential(5) X
#> Exponential distribution (rate = 5)
random(X, 10)
#> [1] 0.01161126 0.28730930 1.15993941 0.29660927 0.38431337 0.04643808 #> [7] 0.06969554 0.10900366 0.50608948 0.03759968
pdf(X, 2)
#> [1] 0.0002269996
log_pdf(X, 2)
#> [1] -8.390562
cdf(X, 4)
#> [1] 1
quantile(X, 0.7)
#> [1] 0.2407946
cdf(X, quantile(X, 0.7))
#> [1] 0.7
quantile(X, cdf(X, 7))
#> [1] 6.989008