distr6: R6 Object-Oriented Probability Distributions Interface in R

distr6 is an object-oriented (OO) probability distributions interface leveraging the extensibil ity 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 gener ating 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.

Raphael Sonabend , Franz J. Király

CRAN packages used

distr6, distr, R6, extraDistr, actuar, distributions3, distributional, mistr, R62S3, Rcpp, set6, microbenchmark

CRAN Task Views implied by cited packages

Distributions, NumericalMathematics, Finance, HighPerformanceComputing, Robust


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, "The R Journal: distr6: R6 Object-Oriented Probability Distributions Interface in R", {The R Journal}, 2020

BibTeX citation

  author = {Sonabend, Raphael and Király, Franz J.},
  title = {The R Journal: distr6: R6 Object-Oriented Probability Distributions Interface in R},
  journal = {{The R Journal}},
  year = {2020},
  note = {https://doi.org/10.32614/RJ-2021-055},
  doi = {10.32614/RJ-2021-055},
  volume = {13},
  issue = {1},
  issn = {2073-4859},
  pages = {444-466}