R/dist_inverse_exponential.R
dist_inverse_exponential.RdThe Inverse Exponential distribution is used to model the reciprocal of exponentially distributed variables.
dist_inverse_exponential(rate)We recommend reading this documentation on pkgdown which renders math nicely. https://pkg.mitchelloharawild.com/distributional/reference/dist_inverse_exponential.html
In the following, let \(X\) be an Inverse Exponential random variable
with parameter rate = \(\lambda\).
Support: \(x > 0\)
Mean: Does not exist, returns NA
Variance: Does not exist, returns NA
Probability density function (p.d.f):
$$ f(x) = \frac{\lambda}{x^2} e^{-\lambda/x} $$
Cumulative distribution function (c.d.f):
$$ F(x) = e^{-\lambda/x} $$
Quantile function (inverse c.d.f):
$$ F^{-1}(p) = -\frac{\lambda}{\log(p)} $$
Moment generating function (m.g.f):
Does not exist (divergent integral).
dist <- dist_inverse_exponential(rate = 1:5)
dist
#> <distribution[5]>
#> [1] InvExp(1) InvExp(2) InvExp(3) InvExp(4) InvExp(5)
mean(dist)
#> [1] NA NA NA NA NA
variance(dist)
#> [1] NA NA NA NA NA
support(dist)
#> <support_region[5]>
#> [1] (0,Inf) (0,Inf) (0,Inf) (0,Inf) (0,Inf)
generate(dist, 10)
#> [[1]]
#> [1] 13.8021890 0.9877194 0.7744026 2.5105879 0.7128985 0.4904117
#> [7] 2.5139989 6.9239931 1.8962487 1.5684503
#>
#> [[2]]
#> [1] 0.9574424 0.7607406 0.1177004 0.1999535 1.7299093 1.2374061 0.2985960
#> [8] 0.4150113 1.8727063 0.4001597
#>
#> [[3]]
#> [1] 0.2341764 0.4005688 0.2327348 0.4116081 0.1812973 0.9476882 0.3853506
#> [8] 0.2300737 0.1534896 0.2575908
#>
#> [[4]]
#> [1] 0.23094569 0.10499863 0.08182342 0.32689129 0.33390858 0.13697665
#> [7] 0.42378682 4.28033007 0.20705127 0.47395913
#>
#> [[5]]
#> [1] 0.2906134 0.4872879 1.9996912 0.2297468 0.1641173 0.1229845 1.0013993
#> [8] 1.5263374 0.2339212 0.2286953
#>
density(dist, 2)
#> [1] 0.15163266 0.09735010 0.07054014 0.05515606 0.04524187
density(dist, 2, log = TRUE)
#> [1] -1.886294 -2.329442 -2.651573 -2.897589 -3.095732
cdf(dist, 4)
#> [1] 0.7788008 0.8824969 0.9200444 0.9394131 0.9512294
quantile(dist, 0.7)
#> [1] 2.8036733 1.4018366 0.9345578 0.7009183 0.5607347