Description Usage Arguments Details Value Author(s) See Also Examples
Density, distribution function, quantile function and random generation for the triangular distribution with range 'min' to 'max' and mode equal to 'mode'.
1 2 3 4 5 6 7 8 9 10 | dtri(x, min=-sqrt(6), max=sqrt(6), mode = (min + max)/2,
log = FALSE)
ptri(q, min=-sqrt(6), max=sqrt(6), mode = (min + max)/2,
lower.tail = TRUE, log.p = FALSE)
qtri(p, min=-sqrt(6), max=sqrt(6), mode = (min + max)/2,
lower.tail = TRUE, log.p = FALSE)
rtri(n, min=-sqrt(6), max=sqrt(6), mode = (min + max)/2)
|
x, q |
Vector of quantiles. |
p |
Vector of quantiles. |
n |
Number of observations. If 'length(n) > 1', the length is taken to be the number required. |
min |
Vector of lower limits of distribution. |
max |
Vector of upper limits of distribution. |
mode |
Vector of modes |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x]; otherwise, P[X > x]. |
log, log.p |
logical; if TRUE, probabilities p are given as log(p). |
The triangular distribution has density
f(x)=2*(x-min) / ((max-min)*(mode-min)) (min < x <= mode)
f(x)=2*(max-x) / ((max-min)*(max-mode)) (mode < x < max)
and 0 elsewhere.
The mean is
(min + mode + max)/3
and the variance is
\frac{1}{18}(min^2 + mode^2 + max^2 - min*mode - min*max - mode*max)
The default values of min
, max
and mode
give a distribution with
mean 0 and unit variance.
If min>max
, min
amd max
will be silently interchanged. If
mode is not within [min, max]
, the functions return NA
, with a warning.
rtri
calls runif(n, 0, 1)
to generate probabilities which are passed to
qtri
.
A vector of densities, probabilities, quantiles or random deviates.
dtri
gives the density, ptri
gives the distribution function,
qtri
gives the quantile function, and rtri
generates random deviates.
S. L. R. Ellison s.ellison@lgc.co.uk
1 2 3 4 5 6 7 8 9 10 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.