ptriang: Triangular Cumulative Distribution Function
Description
Triangular cumulative distribution function with endpoints equal to min and max.
Usage
ptriang(q, min = 0, max = 1, lower.tail = TRUE)
Arguments
q
Vector of quantiles.
min
Left endpoint of the triangular distribution.
max
Right endpoint of the triangular distribution.
lower.tail
Logical; if TRUE (default), probabilities are \(P[X \le x]\); otherwise, \(P[X > x]\).
Value
ptriang gives the distribution function.
Details
The triangular distribution has density
\(4 (x-a) / (b-a)^2\) for \(a \le x \le \mu\), and
\(4 (b-x) / (b-a)^2\) for \(\mu < x \le b\), where
\(a\) and \(b\) are the endpoints, and the mean of the distribution is \(\mu = (a+b) / 2\).