I would like to interpolate a data set which represents a curve of an empirical cumulative distribution function (CDF). Hence, the y entries are between 0 and 1, continuous and non-decreasing, and at the extremities, must equal 0 on the left, 1 on the right with a derivative tending to zero.
An example of data is
data=
{
{406.833, 0.05}, {423.458, 0.1}, {436.375, 0.15}, {448.042, 0.2},
{459.583, 0.25}, {467.75, 0.3}, {479.083, 0.35}, {489.917, 0.4},
{500.875, 0.45}, {508.542, 0.5}, {521.792, 0.55}, {536.75, 0.6},
{547.458, 0.65}, {560.667, 0.7}, {584.208, 0.75}, {598.583, 0.8},
{632.875, 0.85}, {672.583, 0.9}, {726.542, 0.95}
}
The first element of any pair is a value of the $x$ variate; the second element is the cumulative probability $Pr(X \leq x)$. Hence, the second element starts near zero, ends near 1, and is continously non-decreasing in between.
Using Interpolation[data]
, I can plot the estimated function, but it behaves improperly for a CDF as soon as I use a too small x
or a too large x
. For example,
which goes up above 0 before 400, and plunges below 1 (and even negative) after 800.
How can I impose constraints so the interpolation function has the behavior of a CDF?