Learn R Programming

boostmath (version 1.0.0)

triangular_distribution: Triangular Distribution Functions

Description

Functions to compute the probability density function, cumulative distribution function, and quantile function for the Triangular distribution.

Usage

triangular_pdf(x, lower = 0, mode = 1, upper = 2)

triangular_lpdf(x, lower = 0, mode = 1, upper = 2)

triangular_cdf(x, lower = 0, mode = 1, upper = 2)

triangular_lcdf(x, lower = 0, mode = 1, upper = 2)

triangular_quantile(p, lower = 0, mode = 1, upper = 2)

Value

A single numeric value with the computed probability density, log-probability density, cumulative distribution, log-cumulative distribution, or quantile depending on the function called.

Arguments

x

quantile

lower

lower limit of the distribution (default is 0)

mode

mode of the distribution (default is 1)

upper

upper limit of the distribution (default is 2)

p

probability (0 <= p <= 1)

See Also

Boost Documentation for more details on the mathematical background.

Examples

Run this code
# Triangular distribution with lower = 0, mode = 1, upper = 2
triangular_pdf(1)
triangular_lpdf(1)
triangular_cdf(1)
triangular_lcdf(1)
triangular_quantile(0.5)

Run the code above in your browser using DataLab