| triangular | R Documentation |
Density, distribution function, quantile function and random generation for
the triangular distribution with parameters min, max and mode.
ptri(q, min, max, mode)
dtri(x, min, max, mode)
qtri(p, min, max, mode)
rtri(n, min, max, mode)
min |
vector of minimum values. |
max |
vector of maximum values. |
mode |
vector of modes. |
x, q |
vector of quantiles. |
p |
vector of probabilities. |
n |
number of observations. If |
The triangular distribution with parameters min= a, max
= b, mode= c has density:
f(x) =
| \frac{2(x-a)}{(b-a)(c-a)} | for a < x \le c |
\frac{2(b-x)}{(b-a)(b-c)} | for c < x \le b |
|
0 | otherwise |
and distribution function:
F(x) =
| 0 | for x \le a |
\frac{(x-a)^2}{(b-a)(c-a)} | for a < x \le c |
|
1 - \frac{(b-x)^2}{(b-a)(b-c)} | for c < x \le b |
|
1 | for x > b
|
for a \le c \le b.
dtri gives the density, ptri gives the distribution function,
qtri gives the quantile function, and rtri generates random deviates.
ptri(c(0, 1/2, 1), min = 0, max = 1, mode = 1/2)
dtri(c(0, 1/2, 1), min = 0, max = 1, mode = 1/2)
plot(function(x) dtri(x, min = 0, max = 1, mode = 1/2), 0, 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.