The goal of famish is to refine a family of distributions to meet specific requirements, often derived from real data. This includes parameter estimation methods like maximum likelihood, as well as partial constraints such as mean matching. The name “famish” reflects the process of narrowing down a broad family of distributions to those that best fit your needs.
Currently, famish is a quick-and-dirty package slapped together as-needed to tackle project work. Expect major changes.
Installation
You can install the development version of famish from GitHub with:
# install.packages("remotes")
remotes::install_github("probaverse/famish")
Example
Simple example:
library(famish)
x <- stats::rnorm(30)
fit_dst_norm(x)
#> norm parametric dst
#>
#> name :
#> [1] "norm"
More realistic example (under development):
Experts have judged the probability of failure (PoF) of an engineered structure to be 5%, and are 90% certain that the PoF falls between 1% and 10%. What distribution should be fit to the PoF?
- Since PoF must be between 0 and 1, we may start with the Beta family of distributions.
# fam <- dst_beta()
- We for sure want the expected value to be 5%, so we restrict the family to only those Beta distributions with a mean of 5%:
# fam2 <- restrict(fam, ...)
- Finally narrow the family down to the distribution whose 5th and 95th percentiles are close to 1% and 10%, respectively:
# resolve(fam2, ...)
Together in a pipe:
# dst_beta() |>
# restrict(...) |>
# resolve(...)