# Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.
BUILT-IN WOLFRAM LANGUAGE SYMBOL

# QuantityDistribution

QuantityDistribution[dist,unit]
represents a distribution dist of quantities with unit specified by unit.

QuantityDistribution[dist,{unit1,unit2,}]
represents a multivariate distribution with units {unit1,unit2,}.

## DetailsDetails

• QuantityDistribution is typically created by using quantities in parametric, derived distributions or estimated from data with quantities.
• QuantityDistribution will automatically attempt to parse an unknown unit string to its canonical form. »
• QuantityDistribution[dist,unit] is equivalent to TransformedDistribution[Quantity[x,unit],x dist]. »
• The arguments to distribution functions are assumed to have units compatible with unit. »
• The values of distribution functions for univariate distributions have the following units:
•  CDF unitless InverseCDF unit SurvivalFunction unitless InverseSurvivalFunction unit
• The values of PDF and HazardFunction have the following units: »
•  continuous univariate dist unit-1 continuous multivariate dist unit1-1 unit2-1 … discrete dist unitless
• Moments of univariate QuantityDistribution[dist,unit] have the following units:
•  Moment[…,r] unit r CentralMoment[…,r] unit r Cumulant[…,r] unit r FactorialMoment[…,r] unit r
• Moments of multivariate QuantityDistribution[dist,unit] have the following units:
•  Moment[…,{r1,r2,…}] unit1r1 unit2r2 … CentralMoment[…,{r1,r2,…}] unit1r1 unit2r2 … Cumulant[…,{r1,r2,…}] unit1r1 unit2r2 … FactorialMoment[…,{r1,r2,…}] unit1r1 unit2r2 …
• Moment-generating functions require their arguments to be quantities with units that are reciprocal to the units of the QuantityDistribution.
• Sampling from QuantityDistribution gives Quantity or QuantityArray.
• QuantityDistribution can be used with such functions as Mean, CDF, RandomVariate, QuantityMagnitude, and Expectation.

## ExamplesExamplesopen allclose all

### Basic Examples  (3)Basic Examples  (3)

Define a distribution for a random position:

 In[1]:=
 Out[1]=

Compute the probability of the position exceeding a threshold:

 In[2]:=
 Out[2]=

Define a distribution of life expectancy:

 In[1]:=
 Out[1]=

Compute conditional life expectancy:

 In[2]:=
 Out[2]=

Fit a model to data with units:

 In[1]:=
 In[2]:=
 Out[2]=

Convert the distribution to another compatible unit:

 In[3]:=
 Out[3]=

Compare with fitting to distribution in hours:

 In[4]:=
 Out[4]=