模拟数量分布
根据数量分布模拟等待时间.
In[1]:=
wait\[ScriptCapitalD] =
QuantityDistribution[ExponentialDistribution[.4], "Minutes"]
Out[1]=
一个观测即是一个 Quantity.
In[2]:=
RandomVariate[wait\[ScriptCapitalD]]
Out[2]=
多条观测的样本组成一个 QuantityArray.
In[3]:=
sample = RandomVariate[wait\[ScriptCapitalD], 100]
Out[3]=
用 Histogram 可视化样本.
In[4]:=
Histogram[sample, AxesLabel -> Automatic]
Out[4]=
计算样本的几个选定的描述性统计量.
In[5]:=
stats = {Mean, Median, Min, Max};
TableForm[Map[#[sample] &, stats], TableHeadings -> {stats, None}]
Out[5]//TableForm=