Function Reference: plinv

statistics: data = plinv (p, x, Fx)

Inverse of the piecewise linear distribution (iCDF).

For each element of p, compute the quantile (the inverse of the 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_p size and at least 2-elements long.. The size of data is the same_p as p.

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

See also: plcdf, plpdf, plrnd, plstat

Source Code: plinv

Example: 1

 

 ## Plot various iCDFs from the Piecewise linear distribution
 p = 0.001:0.001:0.999;
 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];
 data1 = plinv (p, x1, Fx1);
 data2 = plinv (p, x2, Fx2);
 plot (p, data1, "-b", p, data2, "-g")
 grid on
 legend ({"x1, Fx1", "x2, Fx2"}, "location", "northwest")
 title ("Piecewise linear iCDF")
 xlabel ("probability")
 ylabel ("values in data")

                    
plotted figure