TriangularDistribution
✖
TriangularDistribution
represents a symmetric triangular statistical distribution giving values between min and max.
represents a symmetric triangular statistical distribution giving values between 0 and 1.
Details
- The mean of a pair of uniformly distributed random variables follows a symmetric triangular distribution. »
- TriangularDistribution allows min, max, and c to be any real numbers such that min<c<max.
- TriangularDistribution allows min, max, and c to be quantities of the same unit dimensions. »
- TriangularDistribution can be used with such functions as Mean, CDF, and RandomVariate. »
Background & Context
- TriangularDistribution[{min,max},c] represents a continuous statistical distribution supported over the interval min≤x≤max and parametrized by three real numbers min, max, and c (where min<c<max) that specify the lower endpoint of its support, the upper endpoint of its support, and the -coordinate of its mode, respectively. In general, the PDF of a triangular distribution is triangular (piecewise linear, concave down, and unimodal) with a single "peak" (i.e. a global maximum), though its overall shape (its height, its spread, and the horizontal location of its maximum) is determined by the values of min, max, and c. The one-parameter form TriangularDistribution[{min,max}] is equivalent to TriangularDistribution[{min,max},c] for , while the zero-parameter form TriangularDistribution[] is equivalent to TriangularDistribution[{0,1},1/2]. Triangular distributions that are symmetric are sometimes referred to as tine distributions.
- The triangular distribution dates back to the eighteenth century and the work of English academic Thomas Simpson, though its first modern treatment came in the mid-1930s. Historically, the distribution was used as a tool to model probabilistic quantities related to or stemming from variates modeled by other distributions (e.g. the triangular distribution is the distribution modeling the mean of two uniform random variates), though recently the triangular distribution has been used for modeling in a variety of fields. For example, the triangular distribution is at the center of a wide variety of literature dealing with project evaluation and review techniques. The distribution is also a popular tool in Monte Carlo simulation and has been used to model phenomena in areas such as discrete system simulation, uncertainty and machine learning, finance, and supply chain management.
- RandomVariate can be used to give one or more machine- or arbitrary-precision (the latter via the WorkingPrecision option) pseudorandom variates from a triangular distribution. Distributed[x,TriangularDistribution[{min,max},c]], written more concisely as xTriangularDistribution[{min,max},c], can be used to assert that a random variable x is distributed according to a triangular distribution. Such an assertion can then be used in functions such as Probability, NProbability, Expectation, and NExpectation.
- The probability density and cumulative distribution functions for triangular distributions may be given using PDF[TriangularDistribution[{min,max},c],x] and CDF[TriangularDistribution[{min,max},c],x]. The mean, median, variance, raw moments, and central moments may be computed using Mean, Median, Variance, Moment, and CentralMoment, respectively.
- DistributionFitTest can be used to test if a given dataset is consistent with a triangular distribution, EstimatedDistribution to estimate a parametric triangular distribution from given data, and FindDistributionParameters to fit data to a triangular distribution. ProbabilityPlot can be used to generate a plot of the CDF of given data against the CDF of a symbolic triangular distribution, and QuantilePlot to generate a plot of the quantiles of given data against the quantiles of a symbolic triangular distribution.
- TransformedDistribution can be used to represent a transformed triangular distribution, CensoredDistribution to represent the distribution of values censored between upper and lower values, and TruncatedDistribution to represent the distribution of values truncated between upper and lower values. CopulaDistribution can be used to build higher-dimensional distributions that contain a triangular distribution, and ProductDistribution can be used to compute a joint distribution with independent component distributions involving triangular distributions.
- TriangularDistribution is related to a number of other distributions. The mean of two uniform variables follows TriangularDistribution so that the distributions UniformSumDistribution[2,{min,max}] and TriangularDistribution[{min,max}] have proportional characteristic functions (CharacteristicFunction). TriangularDistribution is generalized by BatesDistribution, in the sense that the characteristic function of TriangularDistribution[] is precisely that of BatesDistribution[2], and is also closely related to UniformDistribution, VonMisesDistribution, LogisticDistribution, WeibullDistribution, LaplaceDistribution, and ChiSquareDistribution.
Examples
open allclose allBasic Examples (4)Summary of the most common use cases
https://wolfram.com/xid/0fq5h6rgb205m-g8syzo
https://wolfram.com/xid/0fq5h6rgb205m-evuhg
https://wolfram.com/xid/0fq5h6rgb205m-i1gcmf
Cumulative distribution function:
https://wolfram.com/xid/0fq5h6rgb205m-5td9mj
https://wolfram.com/xid/0fq5h6rgb205m-4rtcrs
https://wolfram.com/xid/0fq5h6rgb205m-fi5g1j
https://wolfram.com/xid/0fq5h6rgb205m-9lqe2i
https://wolfram.com/xid/0fq5h6rgb205m-n8hln9
https://wolfram.com/xid/0fq5h6rgb205m-cgchn6
https://wolfram.com/xid/0fq5h6rgb205m-cunlhz
Scope (8)Survey of the scope of standard use cases
Generate a sample of random numbers from a triangular distribution:
https://wolfram.com/xid/0fq5h6rgb205m-9f3xcc
Compare its histogram to the PDF:
https://wolfram.com/xid/0fq5h6rgb205m-03mwaz
Distribution parameters estimation:
https://wolfram.com/xid/0fq5h6rgb205m-45b7g2
Estimate the distribution parameters from sample data:
https://wolfram.com/xid/0fq5h6rgb205m-epi747
Compare the density histogram of the sample with the PDF of the estimated distribution:
https://wolfram.com/xid/0fq5h6rgb205m-f8ui5o
Skewness varies with the shape parameter c:
https://wolfram.com/xid/0fq5h6rgb205m-7v0wu
https://wolfram.com/xid/0fq5h6rgb205m-hg0
Skewness is 0 in the symmetric case:
https://wolfram.com/xid/0fq5h6rgb205m-fcnhxz
https://wolfram.com/xid/0fq5h6rgb205m-wtw
https://wolfram.com/xid/0fq5h6rgb205m-1toqno
Different moments with closed forms as functions of parameters:
https://wolfram.com/xid/0fq5h6rgb205m-js043h
https://wolfram.com/xid/0fq5h6rgb205m-rx074o
Moment has closed form:
https://wolfram.com/xid/0fq5h6rgb205m-0vnvlm
https://wolfram.com/xid/0fq5h6rgb205m-pknsqa
Closed form for symbolic order:
https://wolfram.com/xid/0fq5h6rgb205m-ttd70r
https://wolfram.com/xid/0fq5h6rgb205m-zg9ct4
https://wolfram.com/xid/0fq5h6rgb205m-9gzmth
https://wolfram.com/xid/0fq5h6rgb205m-enh8a
https://wolfram.com/xid/0fq5h6rgb205m-xgppmo
https://wolfram.com/xid/0fq5h6rgb205m-ujv5ss
https://wolfram.com/xid/0fq5h6rgb205m-pnd
Consistent use of Quantity in parameters yields QuantityDistribution:
https://wolfram.com/xid/0fq5h6rgb205m-b7r1bo
Find dispersion of the density:
https://wolfram.com/xid/0fq5h6rgb205m-6knzr
Applications (2)Sample problems that can be solved with this function
An executive is given an account of historical seasonal demands for a product in millions of units. The minimum, maximum, and most likely demands are 1, 1.4, and 1.25, respectively. Find the expected demand and its standard deviation using TriangularDistribution:
https://wolfram.com/xid/0fq5h6rgb205m-ml13e
https://wolfram.com/xid/0fq5h6rgb205m-b4lsgs
https://wolfram.com/xid/0fq5h6rgb205m-c4c89
The momentum of a secondary particle from a synchrotron beam is modeled by TriangularDistribution:
https://wolfram.com/xid/0fq5h6rgb205m-gib8vy
The distribution is symmetric and attains maximum at :
https://wolfram.com/xid/0fq5h6rgb205m-mbjwt1
Find momenta where distribution density is at half-height:
https://wolfram.com/xid/0fq5h6rgb205m-8jqt6
Find the full width at half‐height:
https://wolfram.com/xid/0fq5h6rgb205m-hu6bbf
Properties & Relations (6)Properties of the function, and connections to other functions
Triangular distribution is closed under translation and scaling by a positive factor:
https://wolfram.com/xid/0fq5h6rgb205m-3wjaf7
https://wolfram.com/xid/0fq5h6rgb205m-dcr9nu
Relationships to other distributions:
The mean of two uniform variables follows TriangularDistribution:
https://wolfram.com/xid/0fq5h6rgb205m-qunjqq
https://wolfram.com/xid/0fq5h6rgb205m-z2ydyv
https://wolfram.com/xid/0fq5h6rgb205m-rwikdc
Triangular distribution is a special case of BatesDistribution:
https://wolfram.com/xid/0fq5h6rgb205m-rplsiy
https://wolfram.com/xid/0fq5h6rgb205m-j64rox
https://wolfram.com/xid/0fq5h6rgb205m-serz4k
ArcSinDistribution is a transformation of TriangularDistribution:
https://wolfram.com/xid/0fq5h6rgb205m-7es3k1
The default position for c is in the middle of the support interval:
https://wolfram.com/xid/0fq5h6rgb205m-nu3p3x
https://wolfram.com/xid/0fq5h6rgb205m-8j01gi
https://wolfram.com/xid/0fq5h6rgb205m-n9ommh
Possible Issues (2)Common pitfalls and unexpected behavior
TriangularDistribution is not defined when min or max is not real:
https://wolfram.com/xid/0fq5h6rgb205m-ynz
TriangularDistribution is not defined when c is not between min and max:
https://wolfram.com/xid/0fq5h6rgb205m-lic047
Substitution of invalid parameters into symbolic outputs gives results that are not meaningful:
https://wolfram.com/xid/0fq5h6rgb205m-t70
Wolfram Research (2007), TriangularDistribution, Wolfram Language function, https://reference.wolfram.com/language/ref/TriangularDistribution.html (updated 2016).
Text
Wolfram Research (2007), TriangularDistribution, Wolfram Language function, https://reference.wolfram.com/language/ref/TriangularDistribution.html (updated 2016).
Wolfram Research (2007), TriangularDistribution, Wolfram Language function, https://reference.wolfram.com/language/ref/TriangularDistribution.html (updated 2016).
CMS
Wolfram Language. 2007. "TriangularDistribution." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/TriangularDistribution.html.
Wolfram Language. 2007. "TriangularDistribution." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/TriangularDistribution.html.
APA
Wolfram Language. (2007). TriangularDistribution. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TriangularDistribution.html
Wolfram Language. (2007). TriangularDistribution. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TriangularDistribution.html
BibTeX
@misc{reference.wolfram_2024_triangulardistribution, author="Wolfram Research", title="{TriangularDistribution}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/TriangularDistribution.html}", note=[Accessed: 10-January-2025
]}
BibLaTeX
@online{reference.wolfram_2024_triangulardistribution, organization={Wolfram Research}, title={TriangularDistribution}, year={2016}, url={https://reference.wolfram.com/language/ref/TriangularDistribution.html}, note=[Accessed: 10-January-2025
]}