Description Usage Arguments Details Value Author(s) References See Also Examples
These functions provide information about the triangle distribution on the
interval from a
to b
with a maximum at c
. dtriangle
gives the density, ptriangle
gives the distribution function,
qtriangle
gives the quantile function, and rtriangle
generates
n
random deviates.
1 2 3 4 |
x,q |
vector of quantiles. |
p |
vector of probabilities. |
a |
lower limit of the distribution. |
b |
upper limit of the distribution. |
c |
mode of the distribution. |
n |
number of observations. If |
All probabilities are lower tailed probabilities.
a
, b
, and c
may be appropriate length vectors except in
the case of rtriangle
.
rtriangle
is derived from a draw from runif
.
The triangle distribution has density:
f(x) = 2(x-a) / [(b-a)(c-a)]
for a <= x < c.
f(x) = 2(b-x) / [(b-a)(b-c)]
for c <= x <= b. f(x) = 0 elsewhere.
The mean and variance are:
E(x) = (a + b + c) / 3
V(x) = (a^2 + b^2 + c^2 - ab - ac - bc) / 18
dtriangle
gives the density, ptriangle
gives the distribution
function, qtriangle
gives the quantile function, and rtriangle
generates random deviates.
Invalid arguments will result in return value NaN
or NA
.
Rob Carnell
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth \& Brooks/Cole.
.Random.seed
about random number generation,
runif
, etc for other distributions.
1 2 3 4 5 6 7 8 9 10 |
[1] 3.004071
[1] 0.6634554
[1] 2
[1] 0.7
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.