# From Survival function to Cumulative density function (CDF), does CDF properties hold?

Given the following CDF values



time    KM_estimate
0.0     0.00
17.0    0.05
19.0    0.10
29.0    0.20
41.0    0.25
48.0    0.30
53.0    0.35
54.0    0.40
56.0    0.55
60.0    0.60
61.0    0.60
63.0    0.68
66.0    0.76
68.0    0.92
69.0    0.92


for the following dataset with right censoring.

    T   E
0   17.0    1
1   19.0    1
2   29.0    1
3   29.0    1
4   41.0    1
5   48.0    1
6   53.0    1
7   54.0    1
8   56.0    1
9   56.0    1
10  56.0    1
11  60.0    1
12  60.0    0
13  61.0    0
14  61.0    0
15  63.0    1
16  66.0    1
17  68.0    1
18  68.0    1
19  69.0    0


It can be seen that the CDF value does not reaches 1.0 which in return violates the property of CDF which is to be non-decreasing monotonic and non-negative with max value == 1.0.

How do we ensure that in such cases the properties of CDF are held?

Code to reproduce:

from lifelines import KaplanMeierFitter
kmf = KaplanMeierFitter()
kmf.fit(T, event_observed=E)

kmf.cumulative_density_
$$$$
`

Yes, as a probability function, the CDF $$F$$ is one minus the survival function $$S(t) = 1-F(t)$$. However, the Kaplan-Meier estimate will only go to 0 if the last event in the sample is a death event. Otherwise, it will have a positive limit. While the Kaplan-Meier is an unbiased estimate of the survival function, the behavior can't be trusted out in the tails. If you use a parametric survival estimate instead then you're golden. You can also take a "super efficient" approach and modify the KM curve to set the survival curve to 0 for any value after, say, two times the maximum time. Why not?