Wolfram Language

Quantities in Probability & Statistics

Random Vectors with Different Units

Define a joint heightweight distribution with assumed correlation of 0.65.

In[1]:=
Click for copyable input
hw\[ScriptCapitalD] = BinormalDistribution[{Quantity[1.8, "Meters"], Quantity[85, "Kilograms"]}, {Quantity[0.15, "Meters"], Quantity[9, "Kilograms"]}, 0.65]
Out[1]=

Compute the probability of a person's height being over 1.75 meters, given that the person's weight is above 72 kilograms.

In[2]:=
Click for copyable input
NProbability[ h > Quantity[1.75, "m"] \[Conditioned] w > Quantity[72, "kg"], {h, w} \[Distributed] hw\[ScriptCapitalD]]
Out[2]=

Compute the distribution of the body mass index (BMI) for the assumed population.

In[3]:=
Click for copyable input
bmi\[ScriptCapitalD] = TransformedDistribution[ w/h^2, {h, w} \[Distributed] hw\[ScriptCapitalD]]
Out[3]=

Estimate the distribution of the BMI using a sample histogram.

In[4]:=
Click for copyable input
sample = RandomVariate[bmi\[ScriptCapitalD], 10^5]; Histogram[sample, Automatic, "PDF", AxesLabel -> Automatic]
Out[4]=

Related Examples

de es fr ja ko pt-br ru zh