cupy.random.chisquare#

cupy.random.chisquare(df, size=None, dtype=<class 'float'>)[源码]#

卡方分布。

返回从卡方分布中抽取的样本数组。其概率密度函数定义为

\[f(x) = \frac{(1/2)^{k/2}}{\Gamma(k/2)}x^{k/2-1}e^{-x/2}.\]
参数:
  • df (intarray_like of ints) – 自由度 \(k\)

  • size (inttuple of ints) – 数组的形状。如果为 None,则生成零维数组。

  • dtype – 数据类型说明符。只允许 numpy.float32numpy.float64 类型。

返回:

从卡方分布中抽取的样本。

返回类型:

cupy.ndarray