beta_pdf()beta_pdf()

返回概率密度 beta 函数。Returns the probability density beta function.

beta_pdf(0.2, 10.0, 50.0)

Beta 分布通常用于研究样本中某个因素的变化情况(用百分数表示),如一天中人们看电视所花时间的比例。The beta distribution is commonly used to study variation in the percentage of something across samples, such as the fraction of the day people spend watching television.

语法Syntax

beta_pdf(x, alpha, beta)beta_pdf(x, alpha, beta)

参数Arguments

  • x:一个值,用于对函数进行计算。x : A value at which to evaluate the function.
  • alpha:分布的一个参数。alpha : A parameter of the distribution.
  • beta:分布的一个参数。beta : A parameter of the distribution.

返回Returns

  • 概率 beta 密度函数。The probability beta density function.

说明Notes

如果任何参数都不是数字,则 beta_pdf() 会返回 null 值。If any argument is nonnumeric, beta_pdf() returns null value.

如果 x ≤ 0 或 1 ≤ x,beta_pdf() 会返回 NAN 值。If x ≤ 0 or 1 ≤ x, beta_pdf() returns NaN value.

如果 alpha ≤ 0 或 beta ≤ 0,则 beta_pdf() 会返回 NAN 值。If alpha ≤ 0 or beta ≤ 0, beta_pdf() returns the NaN value.

示例Examples

datatable(x:double, alpha:double, beta:double, comment:string)
[
    0.5, 10.0, 20.0, "Valid input",
    1.5, 10.0, 20.0, "x > 1, yields NaN",
    double(-10), 10.0, 20.0, "x < 0, yields NaN",
    0.1, double(-1.0), 20.0, "alpha is < 0, yields NaN"
]
| extend r = beta_pdf(x, alpha, beta)
xx alphaalpha betabeta commentcomment rr
0.50.5 10 个10 20 个20 有效输入Valid input 0.7461760193109510.746176019310951
1.51.5 10 个10 20 个20 x > 1,生成 NANx > 1, yields NaN NaNNaN
-10-10 10 个10 20 个20 x < 0,生成 NANx < 0, yields NaN NaNNaN
0.10.1 -1-1 20 个20 alpha < 0,生成 NANalpha is < 0, yields NaN NaNNaN

参考References

  • 若要计算 beta 累积概率密度函数的反函数,请参阅 beta-inv()For computing the inverse of the beta cumulative probability density function, see beta-inv().
  • 有关标准累积 beta 分布函数,请参阅 beta-cdf()For the standard cumulative beta distribution function, see beta-cdf().