- Fix massive bottleneck in Matdist and Arrdist
- Add
decorators
argument toc.Matdist
andc.Arrdist
- Add 'transformer' functions
pdfcdf
andcdfpdf
, which use Rcpp to transform matrics/arrays/vectors between pdf->cdf and cdf->pdf respectively.
- Add
Arrdist
, which generalises theMatdist
to a three-dimensional array, useful for Bayesian predictions where the third dimension is multiple distributions.
- Added
dparse()
- Fix bug in
plot.Matdist
x limits
- Fix bug when extracting a single distribution with a logical vector from
MatDist
- Fix reordering bug when extracting vector distributions
- Fix minor bug causing decorators not to be carried forward when using
rep
- Fix bug causing vector distributions not to be able to be extracted
- Fixed bug in Matdist where d/p/q/r were transposed incorrectly
- Fixed bug in
- M1mac fix
- Added
Matdist
to simplify the process of creating a vector distribution forWeightedDiscrete
distributions.Matdist
acts as a univariate distribution whilst technically being multivariate - it contains a matrix of probabilities and provides methods for acting on those. - Added methods:
plot.Matdist
to wrapmatplot
aroundMatdist
,c.Matdist
to combine multiple matrix distributions into one,[.Matdist
for extractingWeightedDiscrete
orMatdist
distributions fromMatdist
, andas.Distribution
. - Added
mixMatrix
as a specialised mixing method forMatdist
that creates a newMatdist
instead of aMixtureDistribution
- Possibly breaking change - Changed default of
as.Distribution.matrix
to now coerce to aMatdist
, a vector ofWeightedDisrete
is still possible. - Slight speed improvements to EmpiricalMV
- Fixed r-devel linux warnings
- Fix for Apple M1
- WeightedDiscrete now correctly handles improper distributions by returning Inf and NA where appropriate
- Added constraint on WeightedDiscrete so
cdf
parameter must be increasing - Add distribution method
confidence
to calculate confidence intervals - Fix testing of suggested distributions
- Fixes error in c.VectorDistribution caused by R6 referencing
- Off-by-one error fixed in WeightedDiscrete distribution cdf function
- Speed-ups in pdf, cdf, rand functions in WeightedDiscrete
- Patch for testthat
- Bump param6 version to fix bug in HyperGeometric distribution
- Parameter set interface has been moved to param6. This should not cause breakages if parameters have only been accessed via distribution methods but may otherwise.
- R62S3 is no longer loaded by default, S3 methods must now be manually created with R62S3::R62Fun. This may cause breakages if scripts assume pre-loading but will work as before once R62Fun is called (see S3 and piping vignette)
- Kurtosis and skewness methods now vectorised
- Ids for vector distributions now forced to be alphanumeric
- Deprecated unused arguments from parameter methods
print
method now only shows active parameters- Many other internal improvements to code quality and efficiency
- Fix for M1mac
- Minor internal change
- Added
as.Distribution.matrix
for converting matrices to aVectorDistribution
ofWeightedDiscrete
distributions - Added
...
todstrs
to allow decorator argument to be passed through
- Internal changes only
- Fixed bug in extracting distributions from vector distributions
- Added
ids
active binding to more easily get ids of distributions inVectorDistribution
- Added
length.VectorDistribution
- Added
ids
parameter toVectorDistribution
to allow specifying names for wrapped distributions. Extendedextract.VectorDistribution
so these ids can be used for extraction. - Added sugar function
dstr
to construct distributions more easily, e.g.dstr("Binom", size = 4)
instead ofBinomial$new(size = 4)
. - Added sugar function
dstrs
to construct aVectorDistribution
of distributions. ParameterSet
methodsetParameterValue
now includesresolveConflicts
parameter for resolving conflicts between conflicting parameters (see below). This should primarily only be used internally and is useful for transforming composite distributions.
- The separator for composite (wrapped) distributions is now
__
(before_
). This may affect backwards compatibility in rare cases. - Construction and setting of parameters is now changed. Previously this relied on knowing a confusing hierarchy in parameters which would take priority over one another. Now if conflicting parameters are supplied in construction or on setting an error is returned, e.g.
Binomial$new(prob = 0.1, qprob = 0.2)
would cause an error. This may affect bacwards compatibility however should not do so if distributions are correctly constructed/updated without conflicts. setParameterValue
inParameterSet
no longer errors if a non-settable parameter is updated, instead awarning
is given and the parameter is ignored.- Multivariate distributions no longer error if constructed with a single variate, though this is still advised against.
- Internal changes to how
SDistribution
parameter defaults are set. Previously these were set in the constructor with function defaults, now they are set in theParameterSet
. This should not affect backwards compatibility. This should improve speed of distribution construction.
- Data parameter in
WeightedDiscrete
distribution has now been removed.
- Minor bug fixes in some distribution properties.
MixtureDistribution
now usesextraDistr::rmnom
for speed improvements.- Slight improvement to error messages in
ParameterSet
but these will be improved further in a future update. - Minor internal changes to storage method of
SDistribution
ParameterSet
objects. - Fixed typos in parameter sets
- Documentation for
SDistribution
objects has been restructured for easier reading, the distribution default is now included. - Fixed typos
- Fixes for R devel
- Patch for set6
- Add
rep.Distribution
for replicating distributions into vectors, mixtures, or products - Kernels can now be used with vectors/mixtures/products
- Patch for solaris
- Added
cdfSquared2Norm
analytic methods to most kernels - Minor internal patches
- Added coercions from Vector/Mixture/ProductDistribution to Mixture/ProductDistribution via
as.MixtureDistribution
andas.ProductDistribution
- Bugfix in
MixtureDistribution
parameter set - Uneven vectors of
WeightedDiscrete
distributions are now truncated at the minimum length in the vector forpdf, cdf, quantile
CoreStatistics
methods now give the option to usecubature::cubintegrate
and all associated parameters.- Remove
{pracma}
requirement inExoticStatistics
- Bugfix in
WeightedDiscrete
,cdf
was previously positive when below distribution support, now zero. - Added discrete p-norms in
ExoticStatistics
decorator - Removed
suppressMoments
argument inDistribution
and computation of movements in constructor, improving construction speeds. kurtosis
andskewness
type no longer included in properties. The kurtosis and skewness methods are still available as public methods, and the types are still in summary; to manually find these useexkurtosisType
andskewType
.- Empty
ParameterSet
now allowed
- Critical patch for patched Solaris: Updated precision in C++
log
- Critical patches for R devel:
workingSupport
is now a public method and not an active binding
- Multivariate functions in
VectorDistribution
now return arrays - Analytical
median
now available forSDistribution
s where closed form expressions are known - Kernels now implemented in
Rcpp
with analytical log-pdf expressions. Analytical lower.tail and log.p will come in future versions. - Adding plotting for bivariate distributions using
{plotly}
- Added
EmpiricalMV
for empirical multivariate distributions - All documentation now uses roxygen R6
- Distribution
type
is now required in construction customDistribution
s as the previous method of 'guessing' was inefficient. - Added
ParameterSetCollection
forWrapper
s. Same functionality as before but much more efficient. - Added
$addDeps
and$deps
toParameterSet
s to replaceupdateFunc
. This allows faster and more precise control over parameter updates. - Added
$addChecks
and$checks
toParameterSet
s to replace custom checks in distributions, and$addTrafos
and$trafos
to replace custom parameter transformations before setting. These allows clearner control over parameter setting. categories
parameter inCategorical
now callednCategories
- Constructor of
Categorical
now requires elements to be provided as alist
toelements
settable
inParameterSet
now refers to the more intuitive flag that describes if a parameter can be set after construction- Added
length
active binding toParameterSet
to return number of parameters in the set. - Renamed
squared2Norm
inKernel
s topdfSquared2Norm
and addedx
to arguments to allow for shifted norms. - Added
mixturiseVector
for mixing vector distributions
- Individual property and trait accessors deprecated:
$support, $symmetry, $kurtosisType, $skewnessType, $valueSupport, $variateForm, $type
- Separated
Loglogistic
andShiftedLoglogistic
so only the latter has alocation
parameter. Additionally added an analyticalrand
expression toShiftedLoglogistic
, andLoglogistic
now implemented from packageactuar
- Removed deprecated classes:
ArrayDistribution
- Removed deprecated functions:
listSpecialSets
WeighedDiscrete
distribution now stores samples and probabilities as parameters.- Removed
verbose
argument from distribution constructor - Public
update
method inParameterSet
moved toprivate
- Removed
squared2Norm
from theExoticStatistics
decorator - Deprecated
updateFunc
fromParameterSet
- Removed
.getRefParams
fromSDistribution
s and addeddeps
- Bugfix in
decorate
function that was overwriting thedecorators
private field instead of appending - Vastly improved speed of construction of
SDistribution
andKernel
- Bugfix in
$rand
forGeometric
distribution withtrials == TRUE
, previously was randomising between$[1, Inf)$ not$[0, Inf)$ - Changed default
form
parameter inNegativeBinomial
, now errors if supplied argument is not in one of the four choices (previously reverted to "fbs") - Fixed bug in
MultivariateNormal
rand()
which was not adding themean
correctly - Massive bottleneck in
VectorDistribution
for same distribution type removed in d/p/q/r functions as well as non-generating function methods - Improved speed in
VectorDistribution
when only one row or column of data passed to d/p/q -
Dirichlet, DiscreteUniform, Frechet Gumbel, Pareto, Rayleigh, Triangular, Wald
now implemented from packageextraDistr
- Bug fix in
Frechet
$cdf
- Analytical
log
andlower.tail
now available for allSDistributions
and imputation possible for customs withCoreStatistics
-
NegativeBinomial
now uses Rcpp for d/p/q/r - Distributions from
stats
are now vectorised across parameters in C -
Degenerate
,ShiftedLoglogistic
now Rcpp - Removed redundant
K
parameter fromMultivariateNormal
- Bugfix in
Wald
, symmetry was incorrectly flagged as "symmetric" - Fixed bug in
TruncatedDistribution
support - previously support interval type was"[]"
instead of"(]"
. An important implication is that even if truncating at or outside of the distribution limits, the support will still be changed if the distribution was left-closed to become left-open. - Improved speed of assertions by using package
{checkmate}
- Bugfix in
listDistributions
which was overriding filtering withsimplify
- Minor internal Updates
- Next release will be 1.4.0, due to nature of R6 this will break dependencies.
- Bugfix in
decorate
function that was overwriting thedecorators
private field instead of appending - Added
plot.VectorDistribution
for more efficient plotting of mutiple distributions at the same time - Two bug fixes in
MultivariateNormal$rand()
. i) the distribution mean wasn't being added to the transformation correctly; ii) the Choleskey decomposition wasn't transposed causing incorrect simulations
- Added Erlang distribution
- Fixed mistake in documentation for
Weibull
, thanks to Paul Northrop (@paulnorthrop) for pointing this out. - Fixed bug in
plot
preventing onlyquantile
being plotted on its own - Converted descriptive public methods to active bindings. Unfortunately this will break reverse dependencies as there's no way to soft deprecate these. Affected methods are:
decorators, traits, valueSupport, variateForm, type, properties, support, symmetry, sup, inf, dmax, dmin, kurtosisType, skewnessType
- Bug fix in
VectorDistribution
that was causing decorators not to be added properly - Bug fix in
VectorDistribution
that was causing an error when extracting decorated wrapped distributions - Moved package
pracma
to suggests. Removedutils
dependency. - Added checks to assert all packages are installed when required by distributions
- Deprecated
package
field in distributions, now calledpackages
packages
lists all packages required to be installed for a distribution, ifNULL
only distr6 required- Abstracted SetInterval and related classes to the
set6
package - Deprecated
listSpecialSets
, useset6::listSpecialSets
instead - Removed secondary checks on
update
ofParameterSet
, any properly defined distributions will have this covered in primary parameter, thus increasing speed.
as.data.table
has been moved from aParameterSet
method to an S3 dispatch. Fixes an important bug of overloadingas.data.table
but may affect backwards compatibility.- Added
distrSimulate
for convenient simulation from any distribution - Updated
plot
to be able to handle distributions withoutquantile
orrand
. Optimised runtime by preventing automatic computation ofpdf
andcdf
.
- Bug fix in
VectorDistribution
- missingwhich
argument - Bug fix in
Bernoulli
-rand
was incorrectly callingdbinom
notrbinom
- Bug fix in the
mode
of distributions - Added
mode
to documentation
- Added wrapper for VectorDistribution for quick concatenation of constructed distributions,
c.Distribution
VectorDistribution
print
method more in line with base R vectors
plot
function for plotting thepdf, cdf, survival, quantile, hazard, cumhazard
ordistr6
objectslines
function for superimposingdistr6
plotsqqplot
function for comparingdistr6
distributions to each other or to other theoretical distributions- Added
Extract.VectorDistribution
for extracted distributions from inside aVectorDistribution
, see the big update below.
decorate
now allows users to specify the Decorator as a character as well as supplying the object, this makes it simpler when using distr6 whilst unattached- Big changes (and hopefully final) to the
VectorDistribution
. Now theVectorDistribution
only constructs the internal wrapped distributions when they are extracted or when a function, such as d/p/q/r, are called. This massively reduces a bottleneck in constructing the distribution. Additionally added functions for extracting distributions from inside theVectorDistribution
. The only difference that should affect backwards compatibility is that thedistribution
argument must now be a character and not an object. Custom (i.e. non-SDistribution
) distributions should be used in conjunction with thedistlist
initializer. - Changed the lower bound of positive Sets to .Machine$double.xmin as the previous value of 1.1e-15 was too restrictive
- Added
skewness
,kurtosis
,entropy
,mgf
,cf
, andpgf
toWeightedDiscrete
andEmpirical
- Added support for custom distributions in
VectorDistribution
and forCoreStatistics
functions as well as support for only one arguments passed to d/p/q/r for fast comparisons between wrapped distributions
- Bug fix in
WeightedDiscrete
distributionvariance
calculation - Fixed bug in
Empirical
that was stopping the cdf of the first point in the distribution being evaluated - Fixed bug that allowed invalid parameter values to be set for non-reference parameters
- Updated parameter error messages to be more informative
- Improved speed and efficiency in
Distribution
constructor for wrappers
- Added non-central F, T, Chi-Squared, and Beta distributions
- Added WeightedDiscrete distribution. This allows users to supply a data.frame of samples and pdf/cdfs for more efficient usage with empirical discrete estimators (e.g. Kaplan-Meier)
- Added the common survival parameterisation of Weibull distribution
- Updated the listX functions to make them quicker and functional when distr6 is not attached
- Added
suppressMoments
argument toDistribution
constructor to allow for faster construction
- Added
errormsg
argument to assertions so a custom error message can be provided - Fixed error in quantile function in
Empirical
that was causing results to be dropped - Fixed bug in
TruncatedDistribution
that prevented multivariate distributions being truncated - Fixed error in variance of
Empirical
that was calculating sample not population - Moved rare imports to suggests
Empirical
distribution for distributions arising from observed samples (e.g. from MC sampling methods)simulateEmpiricalDistribution
: function for sampling without replacement from anEmpirical
distribution
ArrayDistribution
- This wrapper is now merged withProductDistribution
by adding two new parameters toProductDistribution
that allow for construction either by a distribution list of by naming a distribution and providing a parameter list or data.table
- Added quantile to Categorical distribution and updated its cdf efficiency
-
cdf
of discrete distributions evaluated between integers are now evaluated after rounding down and do not return 0, e.g.Binomial$new()$cdf(1.8) == Binomial$new()$cdf(1)
- Added two additional parameters to
ProductDistribution
:params
anddistribution
, so that it can either function as before or as theArrayDistribution
wrapper which is now deprecated. - Added two additional parameters to
VectorDistribution
:params
anddistribution
, so that it can either function as before or as a generalisation to theArrayDistribution
wrapper which is now deprecated. - Removed automated rounding of numerics when
ParameterSet
expected integer insetParameterValue
- Added parameter
n
tostrprint
andprint
to clean the print method for distributions (especially wrappers) with multiple parameters - Added optional
vectordist
argument toMixtureDistribution
for better compatibility withVectorDistribution
- Changed
short_name
of Uniform, Logistic, Normal, and Triangular kernels to removeKern
. TheClassName
s (and thus constructors) remain the same -
listKernels
andlistSpecialSet
now return data.tables withstringsAsFactors = FALSE
-
Degenerate
distribution re-classified as discrete
- Bug fix in quantile function of huberization wrapper
- Fixed the
rand
return of a Vector Distribution (transposed data.table and added column names) - Fixed spelling mistakes in extension guidelines and removed calls to redundant parameters
- Removed redundant
crayon
dependency - Fixed bug in
MixtureDistribution
that was causingrand
to erroneously return integers - Removed error in
Categorical
documentation - Fixed bug in multi-modal
Categorical
distribution summary
andprint
now returnself
invisibly for better piping
- Updated vignettes to remove redundant distr6 installation via GitHub that was causing a warning on Debian
- Redundant
stopwarn
argument removed fromparameters()
method inDistribution
andParameterSet
classes - Updated Kernel$new() error message to point user to Distribution class
- Fixed broken if/else statement in liesInSetInterval method of SetInterval class
- v1 API is ready to be shipped to CRAN!
- Again see here for the updated API lifecycle
- Tutorials, extension guidelines and other documentation (in appendices) are now on the website
- distr6 is a complete, unified, object-oriented interface to probability distributions in R. Complete with 36 probability distributions and another 11 kernels, distr6 also allows functionality for numerical imputation of methods and statistical functions.
- Now public!
- distr6 API as whole is still very much experimental but analytic features are fairly stable, see here for details on feature lifecycles
- Development continues to be internal, through UCL and The Alan Turing Institute, but we welcome external users to test the API and report bugs, see our contributing guidelines for details including our code of conduct