powered by
Distribution with a triangular density function.
dtriangular(x, min, peak, max, log = FALSE)rtriangular(n, min, peak, max)
rtriangular(n, min, peak, max)
vector of quantiles
lower bound of distribution
peak of triangle density
upper bound of distribution
logical; if TRUE, probabilities p are given as log(p)
number of samples
# NOT RUN { plot(prior("triangular", c(.2, .6, 1.3)), 0, 2) samples <- rtriangular(1e5, .2, .5, 1) hist(samples, 200, FALSE) curve(dtriangular(x, .2, .5, 1), col = 2, add = TRUE, lwd = 2) # }
Run the code above in your browser using DataLab