compute_median_survival_function

compute_median_survival_function(num_candidates: ndarray) ndarray[source]

Compute \(P(Median > x)\) for x in range \([0, max(k)]\).

This function uses dynamic programming to calculate the cumulative distribution of the count of variables <= x, thereby deriving the median’s distribution.

Memory complexity: O(K * n), where K is the maximum value of k.

Parameters:

num_candidates (ndarray) – shape: (n,) The number of candidates.

Returns:

shape: (K,) The survival function. \(K\) denotes the maximum number of candidates.

Return type:

ndarray