Wolfram Language

Quantities in Probability & Statistics

Convert Units of a QuantityDistribution

Define a quantity distribution.

In[1]:=
Click for copyable input
\[ScriptCapitalD] = QuantityDistribution[GammaDistribution[2, 3], "Hours"];

Find distribution of the magnitude in new units.

In[2]:=
Click for copyable input
QuantityMagnitude[\[ScriptCapitalD], "Minutes"]
Out[2]=

Use UnitConvert to obtain quantity distribution in new units.

In[3]:=
Click for copyable input
UnitConvert[\[ScriptCapitalD], "Days"]
Out[3]=

Easily switch between unit systems.

In[4]:=
Click for copyable input
length\[ScriptCapitalD] = QuantityDistribution[BatesDistribution[3, {2.3, 3.5}], "Inches"]
Out[4]=

Convert to standard SI units.

In[5]:=
Click for copyable input
UnitConvert[length\[ScriptCapitalD]]
Out[5]=

Convert to any length unit.

In[6]:=
Click for copyable input
UnitConvert[length\[ScriptCapitalD], "Centimeters"]
Out[6]=

Related Examples

de es fr ja ko pt-br zh