distr6 is an object-oriented (OO) probability distributions interface leveraging the extensibility and scalability of R6 and the speed and efficiency of Rcpp. Over 50 probability distributions are currently implemented in the package with ‘core’ methods, including density, distribution, and generating functions, and more ‘exotic’ ones, including hazards and distribution function anti-derivatives. In addition to simple distributions, distr6 supports compositions such as truncation, mixtures, and product distributions. This paper presents the core functionality of the package and demonstrates examples for key use-cases. In addition, this paper provides a critical review of the object-oriented programming paradigms in R and describes some novel implementations for design patterns and core object-oriented features introduced by the package for supporting distr6 components.
Supplementary materials are available in addition to this article. It can be downloaded at RJ-2021-055.zip
Text and figures are licensed under Creative Commons Attribution CC BY 4.0. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".
For attribution, please cite this work as
Sonabend & Király, "distr6: R6 Object-Oriented Probability Distributions Interface in R", The R Journal, 2021
BibTeX citation
@article{RJ-2021-055, author = {Sonabend, Raphael and Király, Franz J.}, title = {distr6: R6 Object-Oriented Probability Distributions Interface in R}, journal = {The R Journal}, year = {2021}, note = {https://doi.org/10.32614/RJ-2021-055}, doi = {10.32614/RJ-2021-055}, volume = {13}, issue = {1}, issn = {2073-4859}, pages = {470-492} }