Description Usage Arguments Details References Examples
Density, distribution function, quantile function and random generation for the triangular distribution.
1 2 3 4 5 6 7 |
x, q |
vector of quantiles. |
a, b, c |
minimum, maximum and mode of the distribution. |
log, log.p |
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X ≤ x] otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. If |
Probability density function
f(x) = [if x < c:] (2*(x-a)) / ((b-a)*(c-a)) [if x = c:] 2/(b-a) [if x >= c:] (2*(b-x)) / ((b-a)*(b-c))
Cumulative distribution function
F(x) = [if x <= c:] (x-a)^2 / ((b-a)*(c-a)) [if x > c:] 1 - ((b-x)^2 / ((b-a)*(b-c)))
Quantile function
F^-1(p) = [if p < (c-a)/(b-a):] a + sqrt(p*(b-a)*(c-a)) [else:] b - sqrt((1-p)*(b-a)*(b-c))
For random generation MINMAX method described by Stein and Keblis (2009) is used.
Forbes, C., Evans, M. Hastings, N., & Peacock, B. (2011). Statistical Distributions. John Wiley & Sons.
Stein, W. E., & Keblis, M. F. (2009). A new method to simulate the triangular distribution. Mathematical and computer modelling, 49(5), 1143-1147.
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.