Probability Distributions as S3 Objects
Overview
Tools to create and manipulate probability distributions using S3. Generics pdf(), cdf(), quantile(), and random() provide replacements for base R's d/p/q/r style functions. Functions and arguments have been named carefully to minimize confusion for students in intro stats courses. The documentation for each distribution contains detailed mathematical notes.
- New
Empirical()distribution based on a randomsample. This is particularly useful when forecasts are represented by samples rather than by parametric distributions (#98 and #120 by Reto Stauffer). - New
SinhArcsinh()distribution implementing the Sinh-Arcsinh distribution from Jones and Pewsey (2009, Biometrika) (#128 by Reto Stauffer). - Fallback methods for all standard
distributions3methods such ascdf(),pdf(),quantile(),random(), and moments such asmean(),variance(),skewness(), andkurtosis(). These leverage those methods that are available but fill the gaps using numerical integration/differentiation (#120 by Reto Stauffer). - New generic functions
score()andhessian()to compute the score (first derivative of the log-likelihood with respect to the parameters) and Hessian (corresponding second derivative). There are numeric fallback methods for general distribution objects and analytic methods for a few distributions. Thehessian()methods should typically have an argumentexpectedwhich allows to select whether the observed (expected = FALSE) or expected (expected = TRUE) Hessian should be computed. Some methods may only support one or the other specification and throw an error message otherwise (#124 and #128 by Reto Stauffer and Achim Zeileis).
Show all changes in 0.3.0Hide the rest of the changes in 0.3.0
- All distribution constructor functions such as
Poisson()andBinomial()now have default arguments for all distribution parameters. Typically, these new defaults are empty so that for examplePoisson()yields a Poisson distribution of length zero. Only those distributions which already previously had a default such asNormal(mu = 0, sigma = 1)yield a distribution of length one (#26 and #129 by Reto Stauffer). - Methods for
crps()function from the scoringRules package for computing the (continuous) ranked probabiity score of a distribution. This is a useful proper scoring rule as an alternative to the log-likelihood. A numerical fallback method is provided as well (#88 and #120 by Reto Stauffer and Achim Zeileis). - Streamline the
apply_dpqr()workhorse function to avoid unnecessary computations more carefully (#123 and #125 by Achim Zeileis). - Reduce the hard dependencies:
ggplot2is now a "Suggests" dependency and the usage ofglueis replaced by base R functionsprintf()(#126 and #125 by Achim Zeileis). - Avoid using
rlang::check_dots_used()multiple times when calling a single method. For generic functions fromdistributions3, such ascdf()andvariance()etc., the call torlang::check_dots_used()is directly in the generic. For generic functions defined elsewhere, namelyquantile()andmean()from base R andcrps()fromscoringRules, all methods callrlang::check_dots_used()themselves (#127 by Reto Stauffer).
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-18
- ERROR12 OK, 1 ERROR2026-06-16
- OK14 OK2026-03-10
Documentation
- Help pages
- 262 (4 internal)includes a package overview page
- Examples that run
- 100%209 run in a plain check
- Exported functions with examples
- 98%
- Documented parameters
- 94%
- Return-value docs
- 80%
- Help pages citing references
- 1%
- Intro to hypothesis testing HTML
- One sample sign tests HTML
- One sample T-tests HTML
- One sample Z-tests HTML
- One sample Z-tests for a proportion HTML
- one-sample-t-confidence-interval HTML
- Paired tests HTML
- The Poisson distribution: From basic probability theory to regression models HTML
- Two sample Z-tests HTML
- Z confidence interval for a mean HTML
Downloads
Repository
- PRs merged (all time)
- 88%
- Median days to close, 50 most recently updated closed issues
- 399
- Median days to close, 50 most recently updated closed PRs
- 1
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
Commit identities over time
11 development-tooling and community-health practices detected across 7 families in the upstream repository
Checks run against github.com/zeileis/distributions3 on 2026-10-18.
GitHub Pages site last deployed 2026-10-16 · The repository has a site deploy workflow
pkgdown site last built 2026-08-26
Show all practicesHide 3 practices
Dependencies
Installing distributions3 adds 1 package (1 with compiled code, 766 KB of source tarballs). Heaviest: rlang 766 KB.
Code & Tests
Datasets
People & History
Previously maintained by Alex Hayes (0.1.1 to 0.2.3).
Pick two releases to compare their code metrics.
- 0.3.0Latest2026-07-22 · current release · diff ↗ ·
added 15 exports
Empirical, SinhArcsinh, crps.distribution, dempirical, distribution_calculate_moments, dsinharcsinh, hessian, pempirical, psinharcsinh, qempirical, qsinharcsinh, random.distribution, rempirical, rsinharcsinh, score - 0.2.42026-07-22 · diff ↗
- RR 4.6.0 released · 2026-04-24
- 0.2.32025-09-12 · diff ↗
- RR 4.5.0 released · 2025-04-11
- 0.2.2
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- 0.2.12022-09-07 · diff ↗ ·
added 22 exports
HurdleNegativeBinomial, ZINegativeBinomial, ZTNegativeBinomial, ZTPoisson, dhnbinom, dzinbinom, dztnbinom, dztpois, is_continuous, is_discrete, phnbinom, pzinbinom, pztnbinom, pztpois, qhnbinom, qzinbinom, qztnbinom, qztpois, rhnbinom, rzinbinom, rztnbinom, rztpois - 0.2.02022-06-21 · diff ↗ ·
added 15 exports
HurdlePoisson, ZIPoisson, apply_dpqr, dhpois, dzipois, make_positive_integer, make_support, phpois, prodist, pzipois, qhpois, qzipois, rhpois, rzipois, suff_stat - RR 4.2.0 released · 2022-04-22
- 0.1.22022-01-03 · diff ↗ ·
removed 1 export
quantileadded 16 exports
Erlang, Frechet, GEV, GP, GeomAuc, Gumbel, RevWeibull, StatAuc, geom_auc, kurtosis, plot_cdf, plot_pdf, skewness, stat_auc, support, variance - RR 4.1.0 released · 2021-05-18
- RR 4.0.0 released · 2020-04-24
- 0.1.12019-09-03
- RR 3.6.0 released · 2019-04-26
Package metadata
- First published
- 2019-09-03
- Total releases
- 8 / 7 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 3.0.2
- Bundled data
- 1.8 KB / 1 file
- Download size
- 462 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("distributions3")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-22, which the citation names so these numbers can be found later. More on citing and the projects behind them.