Inverse Distribution
invert.Rd
Access the inverse of a distribution. Specifically, if X
is a random
variable coming from a distribution, invert()
returns the
distribution of 1 / X
.
Note
An error is returned if the original distribution
has 0 as a possible outcome
(i.e., eval_pmf(distribution, at = 0, strict = FALSE)
is non-zero),
because 0 does not have a reciprocal.
You can also obtain the inverse distribution by putting
the distribution in the denominator of /
.
Examples
1 / (distionary::dst_pois(3.4) + 1)
#> [1] "inverse" "dst"
#>
#> distribution :
#> [1] "shift" "dst"
#>
#> components :
#> $distribution
#> [1] "pois" "parametric" "dst"
#>
#> name :
#> [1] "pois"
#>
#> $shift
#> [1] 1
#>
invert(distionary::dst_norm(0, 1))
#> [1] "inverse" "dst"
#>
#> distribution :
#> [1] "norm" "parametric" "dst"
#>
#> name :
#> [1] "norm"