Triangular Distribution

The triangular distribution, also known as the triangle distribution, is a continuous probability distribution with a lower limit, an upper limit, and a mode. It is often used when there is limited sample data, and it is defined by three parameters: the minimum value, the maximum value, and the mode.

Definition

The triangular distribution has three parameters: the minimum value a, the maximum value b, and the mode c. The probability density function (PDF) is defined as:

f(x|a,b,c)={0for x<a,2(xa)(ba)(ca)for ax<c,2(bx)(ba)(bc)for cxb,0for x>b.

The cumulative distribution function (CDF) is:

F(x|a,b,c)={0for xa,(xa)2(ba)(ca)for ax<c,1(bx)2(ba)(bc)for cxb,1for xb.

The domain of the triangular distribution is axb. The parameters must satisfy acb.

Applications

  • Project management uses it for PERT analysis in estimating task durations.

  • Risk analysis employs it when limited data is available but minimum, maximum, and most likely values can be estimated.

  • Business planning utilizes it for sales forecasting and cost estimation.

  • Quality control applies it in process capability studies.

Properties

Statistical Properties
PropertyValue
Meana+b+c3
Variancea2+b2+c2abacbc18
Skewness2(a+b2c)(2abc)(a2b+c)5(a2+b2+c2abacbc)3/2
Excess Kurtosis35
MedianSee note below
Modec

Notable properties include:

  • The median is given by m={a+(ba)(ca)2if ca+b2b(ba)(bc)2if c<a+b2

  • The distribution is symmetric when c=a+b2.

  • The support is finite: [a,b].

Relationships to Other Distributions

  • The triangular distribution is a special case of the beta distribution with specific parameter values.

  • When c=a+b2, it becomes symmetric and resembles a crude approximation to the normal distribution.

  • It can be used as a rough approximation to the beta distribution when limited data is available.

The TriangularDistribution class

The triangular distribution is implemented by the TriangularDistribution class. It has three constructors. The first constructor takes just one argument: the mode. The minimum and maximum values are set to 0 and 1, respectively. The second constructor takes two arguments and adds the maximum value. Finally, the third constructor takes three arguments: the minimum, the maximum, and the mode (most likely value).

The following constructs the same triangular distribution over the interval [0, 1] with mode 0.6:

C#
var triangular1 = new TriangularDistribution(0.6);
var triangular2 = new TriangularDistribution(1.0, 0.6);
var triangular3 = new TriangularDistribution(0.0, 1.0, 0.6);

The TriangularDistribution class has three specific properties, LowerBound, UpperBound, and Mode, which return the three parameters of the distribution.

TriangularDistribution has one static (Shared in Visual Basic) method, Sample, which generates a random sample using a user-supplied uniform random number generator. The second and third parameters are the location and scale parameters of the distribution.

C#
var random = new Pcg32();
double sample = TriangularDistribution.Sample(random, 6.8, 1.8);

The above example uses the MersenneTwister class to generate uniform random numbers.

References

For more information on the triangular distribution, refer to the following sources:

  • Johnson, N. L., Kotz, S., & Balakrishnan, N. (1994). "Continuous Univariate Distributions, Volume 2", Chapter 26. Wiley Series in Probability and Statistics.

  • Forbes, C., Evans, M., Hastings, N., & Peacock, B. (2011). "Statistical Distributions", Chapter 44. Wiley Series in Probability and Statistics.

See Also