docs
docs copied to clipboard
Incorrect formula for triangle density
Summary:
Section 21.1 ("Custom Probability Function" > "Examples" > "Triangle distribution") give an incorrect formula for the pdf of the triangle distribution.
Description:
The text gives for formula as
$$ \textsf{triangle}(y \mid \alpha,\beta) = \frac{2}{\beta - \alpha}\ \left(1 - \left|y - \frac{\alpha + \beta}{\beta - \alpha}\right|\right) $$
but this is wrong, as you can easily see by setting $\alpha = 2$ and $\beta = 8$. (The mode should be at $y=5$, but $(2+8)/(8-2) = 5/3$.)
Additional Information:
The correct formula is
$$ \textsf{triangle}(y \mid \alpha,\beta) = \frac{2}{\beta - \alpha}\ \left(1 - \frac{2}{\beta - \alpha}\left|y - \frac{\alpha + \beta}{2}\right|\right) $$
for $y\in [\alpha, \beta]$.
Current Version:
v2.32