These functions provide information about the triangle distribution on the
logarithmic interval from a to b with a maximum at c. dltriangle
gives the density, pltriangle gives the distribution function,
qltriangle gives the quantile function, and rltriangle generates
n random deviates.
number of observations. If length(n) > 1, the length
is taken to be the number required.
logbase
the base of the logarithm to use.
Details
All probabilities are lower tailed probabilties.
a, b, and c may be appropriate length vectors except in
the case of rtriangle.
Value
dltriangle gives the density, pltriangle gives the distribution
function, qltriangle gives the quantile function, and rltraingle
generates random deviates.
Invalid arguments will result in return value NaN or NA.
Author(s)
Rob Carnell
References
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
The New S Language.
Wadsworth & Brooks/Cole.
See Also
.Random.seed about random number generation,
runif, etc for other distributions.
Examples
## view the distribution
tri <- rltriangle(100000, 1, 100, 10)
hist(log10(tri), breaks=100, main="Triangle Distribution", xlab="x")
dltriangle(10, 1, 100, 10) # 2/(log10(b)-log10(a)) = 1
qltriangle(pltriangle(10)) # 10