beta_pdf()
Returns the probability density beta function.
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)
Learn more about syntax conventions.
Parameters
Name | Type | Required | Description |
---|---|---|---|
x | int, long, or real | ✔️ | A value at which to evaluate the function. |
alpha | int, long, or real | ✔️ | A parameter of the distribution. |
beta | int, long, or real | ✔️ | A parameter of the distribution. |
Returns
The probability beta density function.
Note
- If any argument is nonnumeric, the function returns
null
. - If
x ≤ 0
or1 ≤ x
, the function returnsNaN
. - If
alpha ≤ 0
orbeta ≤ 0
, the function returnsNaN
.
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)
Output
x | alpha | beta | comment | r |
---|---|---|---|---|
0.5 | 10 | 20 | Valid input | 0.746176019310951 |
1.5 | 10 | 20 | x > 1, yields NaN | NaN |
-10 | 10 | 20 | x < 0, yields NaN | NaN |
0.1 | -1 | 20 | alpha is < 0, yields NaN | NaN |
Related content
- For computing the inverse of the beta cumulative probability density function, see beta-inv().
- For the standard cumulative beta distribution function, see beta-cdf().
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for