Calculate the empirical cumulative density function (CDF) of a sample of points (y) for use in the discontinuous Kolmogorov-Smirnov test at the points in y.calc. The samples are assumed to all be on the interval 0 to 1 (as for the Martingale Survival Residual (MSR)), and the CDF is assumed to be continuous up to a stopping time at which the transition is guaranteed to occur if it has not occurred already. Whether the stopping time was reached is indicated by the boolean vector halt. Duplicate values of y are acceptable. The optional input "where" indicates whether the CDF should be calculated after the transition (default), instantaneously before the transition transition, or both; this only matters if y.calc contains values that are also in y (i.e, a calculation is done where a transition occurs in y). If y.calc is not specified, it is assumed to be all the values of y.

calcStoppingCDF(y, halt, y.calc = NA, where = "after")

Arguments

y

A vector of samples

halt

A boolean vector indicating whether the stopping time was reached

y.calc

Points at which to calculate the CDF

where

Whether to calculate the CDF before or after the transition (or both)

Value

The CDF evaluated at the unique values of y (or y.calc) as a list with the following entries

y

The unique values of y or y.calc

before

The value of the CDF immediately before each y

after

The value of the CDF immediately after each y

References

https://www.biorxiv.org/content/early/2017/01/31/104406

See also

calcECDFPointPairs, addECDFLinesToPlot