Function Reference: triinv

statistics: x = triinv (p, a, b, c)

Inverse of the triangular cumulative distribution function (iCDF).

For each element of p, compute the quantile (the inverse of the CDF) of the triangular distribution with lower limit parameter a, peak location (mode) parameter b, and upper limit parameter c. The size of x is the common size of the input arguments. A scalar input functions as a constant matrix of the same size as the other inputs.

Note that the order of the parameter input arguments has been changed after statistics version 1.6.3 in order to be MATLAB compatible with the parameters used in the TriangularDistribution probability distribution object. More specifically, the positions of the parameters b and c have been swapped. As a result, the naming conventions no longer coinside with those used in Wikipedia, in which b denotes the upper limit and c denotes the mode or peak parameter.

Further information about the triangular distribution can be found at https://en.wikipedia.org/wiki/Triangular_distribution

See also: tricdf, tripdf, trirnd, tristat

Source Code: triinv

Example: 1

 

 ## Plot various iCDFs from the triangular distribution
 p = 0.001:0.001:0.999;
 x1 = triinv (p, 3, 6, 4);
 x2 = triinv (p, 1, 5, 2);
 x3 = triinv (p, 2, 9, 3);
 x4 = triinv (p, 2, 9, 5);
 plot (p, x1, "-b", p, x2, "-g", p, x3, "-r", p, x4, "-c")
 grid on
 ylim ([0, 10])
 legend ({"a = 3, b = 6, c = 4", "a = 1, b = 5, c = 2", ...
          "a = 2, b = 9, c = 3", "a = 2, b = 9, c = 5"}, ...
         "location", "northwest")
 title ("Triangular CDF")
 xlabel ("probability")
 ylabel ("values in x")

                    
plotted figure