mars.tensor.random.standard_cauchy#
- mars.tensor.random.standard_cauchy(size=None, chunk_size=None, gpu=None, dtype=None)[来源]#
从标准柯西分布中抽取样本,模式 = 0。
也被称为洛伦兹分布。
- Parameters
- Returns
样本 – 绘制的样本。
- Return type
张量或标量
备注
完整的柯西分布的概率密度函数是
\[P(x; x_0, \gamma) = \frac{1}{\pi \gamma \bigl[ 1+ (\frac{x-x_0}{\gamma})^2 \bigr] }\]标准Cauchy分布只需设置 \(x_0=0\) 和 \(\gamma=1\)
柯西分布出现在驱动谐振子问题的解中,并且描述了光谱线的展宽。它还描述了一条以随机角度倾斜的直线将与 x 轴相交的值的分布。
在研究假设检验假定正态性时,查看这些检验在来自柯西分布的数据上的表现是它们对重尾分布的敏感性的一种良好指标,因为柯西分布看起来非常像高斯分布,但尾部更重。
参考文献
- 1
NIST/SEMATECH 统计方法电子手册,“柯西分布”,http://www.itl.nist.gov/div898/handbook/eda/section3/eda3663.htm
- 2
韦斯坦,埃里克·W。“柯西分布。”来自MathWorld–A Wolfram网络资源。 http://mathworld.wolfram.com/CauchyDistribution.html
- 3
维基百科,“柯西分布” http://en.wikipedia.org/wiki/Cauchy_distribution
示例
绘制样本并绘制分布:
>>> import mars.tensor as mt >>> import matplotlib.pyplot as plt
>>> s = mt.random.standard_cauchy(1000000) >>> s = s[(s>-25) & (s<25)] # truncate distribution so it plots well >>> plt.hist(s.execute(), bins=100) >>> plt.show()