ptriangle {rotRPackage} | R Documentation |
This function computes the CDF of the triangular distribution over the given input vector.
ptriangle(x, a=0, m=0.5, b=1)
x |
Point(s) where the CDF is computed, vector |
a |
The lower bound of the Triangular distribution, real. |
m |
The most likely value of the Triangular distribution, real, a <= m <= b. |
b |
The upper bound of the Triangular distribution, real, b > a |
The triangular distribution has the following density function: $$ f(x, a, m, b) = 2 (x - a) / ((m - a)(b - a)) if a <= x <= m f(x, a, m, b) = 2 (b - x) / ((b - m)(b - a)) if m < x <= b $$
The CDF value(s), vector
Pierre-Matthieu Pair, Régis Lebrun.
# Standard Triangular distribution example. x <- (1000) * 8 plot(x, ptriangle(x, 1, 3, 7))