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] 9.0658340 4.2603587 1.8540248 1.1129458 3.8568059 1.6528941
#> [7] 11.8383645 3.8168648 0.5250432 0.4965451
#>
#> [[2]]
#> [1] 5.5077358 0.1570807 20.1726803 0.5698514 1.7885496 1.0168178
#> [7] 44.4683563 0.3215533 16.6109045 17.7852827
#>
#> [[3]]
#> [1] 0.1944391 1.1745734 0.1955216 0.1817387 0.7454506 0.2655227 0.2968903
#> [8] 1.4573653 0.1730864 0.1495535
#>
#> [[4]]
#> [1] 0.27230774 0.14022059 0.72446529 19.94129825 9.19589303 0.07613331
#> [7] 0.41241180 0.93223103 0.46069665 70.87201753
#>
#> [[5]]
#> [1] 0.47328594 0.07843704 0.08947185 0.18705584 0.60899131 0.22731313
#> [7] 0.25811329 0.07568659 2.76043779 0.19754388
#>
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