Brighton Webs Ltd

statistics for energy and the environment

statistics for energy and the environment

**Triangular Distribution**

The Triangular Distribution is often used as a subjective description of a population. It is based on estimates of the minimum and maximum and an inspired guess as to what the modal value might be. Despite being a simplistic description of a population, it is a useful distribution for modeling subjective probability where hard data is scarce (possibly because of the high cost of collection). One way of obtaining the the min, mode and max parameters is to ask the opinion of someone with appropriate experience. The human mind is good at reducing complex datasets to managable proportions.

It can be used as an alternative to the Beta distribution in PERT, CPM and similar forms of project management tool. The section on the Beta distribution contains an example using both the Beta and Triangular distributions.

Relative to distributions such as the normal and lognormal where only a small proportion of the population is located in the tails, in some applications, the triangular distribution can return a higher proportion of values which are close to the mininum and maximum values.

**Profile**

**Parameters**

Parameter |
Description |
Characteristics |

min | Minimum value | A float > -∞ and <= mode |

mode | Modal Value | A float >= min or <= max |

max | Maximum value | A float >= mode and < ∞ |

**Range**

The range is determined by the min and max parameters.

**Functions**

**Properties**

**Example**

Triangular distributions are used in oil and gas exploration where data is expensive to collect and it is almost impossible to model the population being sampled accurately, thus subjectivity plays a greater role than in data rich sectors. The graph below illustrates the response you might get from a geologist if you asked the question what are minimum, most likely and maximum discovery sizes for a given play.

See the section on the lognormal distribution for an alternative model.

**Parameter Estimation**

The parameters of a triangular distribution can be derived directly from the dataset which it is intended to describe or model. Provided the dataset does not contain any anomalous points, the minimum and maximum can be obtained by sorting the values in ascending order and selecting the first and last points. Un less the mode is being set subjectively, there are a number of ways of determining the mode including:

Use an algorithm such successive bisection

Use the Max, Min and Mean to estimate the mode

This example illustrates both approaches. The figures below are the porosity of rock samples from deep bore holes. These are very expensive to collect and only a few are available to the analyst who may be asked to provide input for some form of Monte-Carlo evaluation:

10.0%, 13.5%, 15.5%, 20.0%

The successive bisection algorithm estimates the mode as 14.5%. The mean value of the observations is 14.75%, using this value together with the min and max into this formula sets the mode as 14.25%:

A subjective estimate of the mode by a cautious analyst might set the mode at 12%.

**Python Example**

Random number generation for a triangular distribution can be performed by transforming a continuous uniform variable in the range 0 to 1 (referred to as U) with the distribution's inverse probability function:

r=g(u)

The code in the frame below performs a simple simulation of a triangularly distributed variable. It generates two lists, one contained the simulated values and the other the expected count for the same interval.

Storing the value from the random number function in the variable u is important because most random number function return a new value each time they are called. Without the use of the u variable, the statement would use one value for branching and another for calculation.

Python is sensitive to indentation errors, it maybe necessary to perform some adjustment of the code following a copy and paste operation.

**Related Pages**