Function Reference: plcdf

statistics: p = plcdf (data, x, Fx)
statistics: p = plcdf (data, x, Fx, "upper")

Piecewise linear cumulative distribution function (CDF).

For each element of data, compute the cumulative distribution function (CDF) of the piecewise linear distribution with a vector of x values at which the CDF changes slope and a vector of CDF values Fx that correspond to each value in x. Both x and Fx must be vectors of the same size and at least 2-elements long. The size of p is the same as data.

p = plcdf (data, x, Fx, "upper") computes the upper tail probability of the piecewise linear distribution with parameters x and Fx, at the values in data.

Further information about the piecewise linear distribution can be found at https://en.wikipedia.org/wiki/Piecewise_linear_function

See also: plinv, plpdf, plrnd, plstat

Source Code: plcdf

Example: 1

 

 ## Plot various CDFs from the Piecewise linear distribution
 data = 0:0.01:10;
 x1 = [0, 1, 3, 4, 7, 10];
 Fx1 = [0, 0.2, 0.5, 0.6, 0.7, 1];
 x2 = [0, 2, 5, 6, 7, 8];
 Fx2 = [0, 0.1, 0.3, 0.6, 0.9, 1];
 p1 = plcdf (data, x1, Fx1);
 p2 = plcdf (data, x2, Fx2);
 plot (data, p1, "-b", data, p2, "g")
 grid on
 ylim ([0, 1])
 xlim ([0, 10])
 legend ({"x1, Fx1", "x2, Fx2"}, "location", "southeast")
 title ("Piecewise linear CDF")
 xlabel ("values in data")
 ylabel ("probability")

                    
plotted figure