|On this page…|
The piecewise linear distribution creates a nonparametric representation of the cumulative distribution function (cdf) by linearly connecting the known cdf values from the sample data.
The piecewise linear distribution uses the following parameters.
|x||Vector of x values at which the cdf changes slope|
|Fx||Vector of cdf values that correspond to each value in x|
The piecewise linear distribution constructs a continuous cumulative distribution function (cdf) by connecting the empirical cdf values such that the cdf increases linearly between x(j) and x(j + 1).
This plot shows how the piecewise linear distribution constructs a continuous cdf from discrete values in the sample data.
% Create a piecewise linear distribution object x = [1:10]; Fx = [0 .1 .23 .3 .5 .62 .78 .81 .89 1]; pd = makedist('piecewiselinear',x,Fx); % Compute and plot the cdf y = cdf(pd,x); figure; scatter(x,y); hold on; plot(x,y); hold off;