The triangular distribution is a useful tool if a variable has to be estimated subjectively. The estimator has to indicate a Low, a Most Likely value (Mode) and a High value, the distribution contained within the Low to High range. In the formulas below "l" is the Low, "m" is the mode and "h" the High value. In other descriptions (Wikipedia) the characters "a", "c" and "b" are used resp. for l, m and h.
The pdf is a triangle:

and as a formula:

The mean is:

The variance is:

The CDF consists of two curved line segments, with a discontinuity at the mode.

In this case it is interesting to know also the inverse form of the cumulative distribution function:

This formula is used in generating a random triangular deviate from a rectangular one between 0 and 1 in Monte Carlo analysis.

Mode estimator

The triangular distribution can be fitted to a data sample to find a rough estimate of the mode. If the distribution type is unknown it is quite difficult to estimate the mode, as no simple analytical solution is at hand. In such case an easy way is to fit a triangular to the data by recording the lowest and the highest values as l and h, as well as calculating the mean. Then the mode (m) is:

Im practice, this estimate is very sensitive to the input parameters and in the Monte Carlo analysis I use a different method to estimate the mode. In a sorted vector X 21 percentiles are extracted. Then the shortest interval of these 5% percentile intervals is chosen. Arbitrarily, the mean of this interval is assumed to a reasonable estimate of the mode of a unimodal distribution. Note: Only used for estimating he mode in an unrisked vector. A risked vector has a number of zero values, a first mode, then somewhere a mode of the non-zero values, hence not unimodal.