Wolfram 语言

概率和统计延伸

随机变量的积/商的 PDF

找出 BetaDistribution[2, 3] 个独立抽样中最小与最大样本比值的概率密度函数.

In[1]:=
Click for copyable input
n = 5; pdf = PDF[ TransformedDistribution[ min/max, {min, max} \[Distributed] OrderDistribution[{BetaDistribution[2, 3], n}, {1, n}]], u]
Out[1]=

可视化密度.

In[2]:=
Click for copyable input
Plot[pdf, {u, 0, 1}, PlotRange -> All, Filling -> Axis, PlotTheme -> "Detailed", ImageSize -> Medium, PlotLegends -> None]
Out[2]=

计算两个三角形分布的乘积的 PDF.

In[3]:=
Click for copyable input
pdf2 = PDF[ TransformedDistribution[ x1 x2, {x1 \[Distributed] TriangularDistribution[{-1, 2}, -1], x2 \[Distributed] TriangularDistribution[{-4, 3}, 2]}], u]
Out[3]=
显示完整的 Wolfram 语言输入
In[4]:=
Click for copyable input
Plot[pdf2, {u, -4, 4}, Exclusions -> None, Filling -> Axis, PlotTheme -> "Detailed", ImageSize -> "Medium", PlotLegends -> None, PlotRange -> All]
Out[4]=

找出两个独立正态随机变量商的 PDF.

In[5]:=
Click for copyable input
pdf3 = PDF[ TransformedDistribution[ z1/z2, {z1 \[Distributed] NormalDistribution[], z2 \[Distributed] NormalDistribution[\[Mu], 1]}], x]
Out[5]=

任何 为固定值的分布都为重尾分布.

In[6]:=
Click for copyable input
Series[Exp[\[Mu]^2/2] pdf3, {x, Infinity, 8}, Assumptions -> \[Mu] > 0] // Expand
Out[6]=
显示完整的 Wolfram 语言输入
In[7]:=
Click for copyable input
Plot[Evaluate[ pdf3 /. {{\[Mu] -> 0}, {\[Mu] -> 1}, {\[Mu] -> 3}, {\[Mu] -> 5}}], {x, -2, 2}, PlotLegends -> {"\[Mu] = 0", "\[Mu] = 1", "\[Mu] = 3", "\[Mu] = 5"}, PlotRange -> All, PlotTheme -> "Detailed", ImageSize -> "Medium"]
Out[7]=

相关范例

de en es fr ja ko pt-br ru