Give Units to Any Distribution
Create a distribution of arrival time in seconds from distribution of its magnitude.
In[1]:=
\[ScriptCapitalD] =
QuantityDistribution[ExponentialDistribution[3], "Seconds"]
Out[1]=
Use QuantityUnit and QuantityMagnitude to extract the unit of the associated random variate and the distribution of its magnitude.
In[2]:=
QuantityUnit[\[ScriptCapitalD]]
Out[2]=
In[3]:=
QuantityMagnitude[\[ScriptCapitalD]]
Out[3]=
Any distribution, including formula distributions, derived distributions, etc., can be used as the distribution of the magnitude.
In[4]:=
mag\[ScriptCapitalD] =
ProbabilityDistribution[{"HF", x}, {x, 0, \[Infinity]}];
In[5]:=
lifetime\[ScriptCapitalD] =
QuantityDistribution[mag\[ScriptCapitalD], "Hours"]
Out[5]=