distributional 0.2.1 Unreleased

A small performance and methods release. Some issues with truncated distributions have been fixed, and some more distribution methods have been added which improve performance of common tasks.

New features

Probability distributions

  • Added dist_missing() for representing unknown or missing (NA) distributions.


Bug fixes

  • Fixed issue with computing the median of dist_truncated() distributions.
  • Fixed format method for dist_truncated() distributions with no upper or lower limit.
  • Fixed issue with naming objects giving an invalid structure. It now gives an informative error (#23).
  • Fixed documentation for Negative Binomial distribution (#46).

distributional 0.2.0 2020-08-03

New features

Probability distributions

  • Added dist_wrap() for wrapping distributions not yet added in the package.


  • Added likelihood() for computing the likelihood of observing a sample from a distribution.
  • Added skewness() for computing the skewness of a distribution.
  • Added kurtosis() for computing the kurtosis of a distribution.
  • The density(), cdf() and quantile() methods now accept a log argument which will use/return probabilities as log probabilities.


  • Improved documentation for most distributions to include equations for the region of support, summary statistics, density functions and moments. This is the work of @alexpghayes in the distributions3 package.
  • Documentation improvements
  • Added support for displaying distributions with View().
  • hilo() intervals can no longer be added to other intervals, as this is a common mistake when aggregating forecasts.
  • Incremented d for numDeriv::hessian() when computing mean and variance of transformed distributions.

Deprecated features

  • Graphics functionality provided by autoplot.distribution() is now deprecated in favour of using the ggdist package. The ggdist package allows distributions produced by distributional to be used directly with ggplot2 as aesthetics.

distributional 0.1.0 2020-06-09

First release.

New features

Object classes

  • distribution: Distributions are represented in a vectorised format using the vctrs package. This makes distributions suitable for inclusion in model prediction output. A distribution is a container for distribution-specific S3 classes.
  • hilo: Intervals are also stored in a vector. A hilo consists of a lower bound, upper bound, and confidence level. Each numerical element can be extracted using $, for example my_hilo$lower to obtain the lower bounds.
  • hdr: Highest density regions are currently stored as lists of hilo values. This is an experimental feature, and is likely to be expanded upon in an upcoming release.

Generic functions

Values of interest can be computed from the distribution using generic functions. The first release provides 9 functions for interacting with distributions:

  • density(): The probability density/mass function (equivalent to d...()).
  • cdf(): The cumulative distribution function (equivalent to p...()).
  • generate(): Random generation from the distribution (equivalent to r...()).
  • quantile(): Compute quantiles of the distribution (equivalent to q...()).
  • hilo(): Compute probability intervals of probability distribution(s).
  • hdr(): Compute highest density regions of probability distribution(s).
  • mean(): Obtain the mean(s) of probability distribution(s).
  • median(): Obtain the median(s) of probability distribution(s).
  • variance(): Obtain the variance(s) of probability distribution(s).


Distribution modifiers