Algorithm Search⌘K

Algorithmadvanced

Turnbull estimator

Also called Turnbull's self-consistency algorithm, NPMLE for interval-censored data.

The nonparametric MLE of the distribution of interval-censored times, found by self-consistency iterations, an EM algorithm, over Turnbull's innermost intervals.

Time
Θ(n log n + k n m) totalΘ(n m) per_iterationΘ(n + m) per_iteration_prefix_sumsΘ(n log n + n m) setup
Space
Θ(n m) extraΘ(n + m) extra_prefix_sums
Where
k = the number of iterations; m = the number of innermost intervals (m ≤ n); n = the number of observations
Properties
deterministicnot exactofflineiterative
Origin
Bruce W. Turnbull, Richard Peto, 1976

The Turnbull estimator is the nonparametric maximum likelihood estimate (NPMLE) of a distribution when each event time is known only to lie in an interval (Li,Ri](L_i, R_i]. Such data arise when a condition is checked at clinic visits, so that an onset is known only to fall between the last negative and the first positive visit. Exact times (Li=RiL_i = R_i) and right-censored times (Ri=∞R_i = \infty) are special cases, and on them the estimator is the Kaplan-Meier estimator. The likelihood depends on the distribution only through the probabilities of a few disjoint sets, Turnbull's innermost intervals, and the masses on them are found by the self-consistency iteration sj←sjgjs_j \leftarrow s_j g_j, which is the EM algorithm for this problem. The estimate of the survival function is determined between the innermost intervals and undetermined inside them.

In plain words

Each person's event happened somewhere inside a known window. We want the distribution of event times that makes these windows as likely as possible. Only a few places matter: the stretches where windows overlap as much as they can. The method starts with equal weight on each such stretch. Then, for each person, it splits that person between the stretches inside their window, in proportion to the current weights. Adding up these shares gives new weights. Repeating this never makes the fit worse, and it settles on the best weights. A simple test tells how far the current weights can still be from the best.

The problem

Input. Observations Ii=(Li,Ri]I_i = (L_i, R_i], i=1,…,ni = 1, \ldots, n, with 0≤Li≤Ri≤∞0 \le L_i \le R_i \le \infty, meaning that the event time TiT_i satisfies Li<Ti≤RiL_i < T_i \le R_i. An exact time tt is Li=Ri=tL_i = R_i = t, read as the point {t}\{t\}; a right censoring at cc is (c,∞](c, \infty]; a left censoring at cc is (0,c](0, c]. The times TiT_i are independent with distribution function FF, and the inspection process that produces the intervals is independent of TiT_i (non-informative interval censoring).

Output. A distribution F^\hat F that maximizes the likelihood

L(F)=∏i=1nPF(T∈Ii),\mathcal L(F) = \prod_{i=1}^n P_F(T \in I_i),

represented by disjoint sets Q1<⋯<QmQ_1 < \cdots < Q_m and masses sj≥0s_j \ge 0 with ∑jsj=1\sum_j s_j = 1, and the survival function S^(t)=∑j: Qj>tsj\hat S(t) = \sum_{j:\, Q_j > t} s_j at every tt outside the QjQ_j.

Innermost intervals. Sort the 2n2n endpoints; at equal values put the closed left ends of exact times first, then right ends, then open left ends. Each left end that is followed directly by a right end gives an innermost interval QjQ_j: (pj,qj](p_j, q_j], or the point {pj}\{p_j\} when it comes from an exact time. With αij=1{Qj⊆Ii}\alpha_{ij} = 1\{Q_j \subseteq I_i\} and Di(s)=∑jαijsjD_i(s) = \sum_j \alpha_{ij} s_j, every maximizer of L\mathcal L can be moved into the QjQ_j without loss, so the problem is the concave program

max⁡s∈Δm ℓ(s)=∑i=1nlog⁡Di(s),Δm={s≥0:∑jsj=1}.\max_{s \in \Delta_m} \ \ell(s) = \sum_{i=1}^n \log D_i(s), \qquad \Delta_m = \Big\{s \ge 0 : \sum_j s_j = 1\Big\}.

The algorithm

  1. TURNBULL(L[1..n], R[1..n], ε)
  2. 1sort the 2n endpoints, at ties exact left ends, then right ends, then open left ends
  3. 2Q[1..m] ← the left ends followed directly by a right end, each paired with that right end
  4. 3α[i][j] ← 1 if Q[j] ⊆ I[i] else 0, for all i and j
  5. 4s[j] ← 1/m for all j
  6. 5repeat
  7. 6D[i] ← Σ_j α[i][j] s[j] for all i ▷ P(T ∈ I[i]) under s
  8. 7g[j] ← (1/n) Σ_i α[i][j] / D[i] for all j ▷ ∂ℓ/∂s[j] divided by n
  9. 8if max_j g[j] ≤ 1 + ε then exit the loop
  10. 9s[j] ← s[j] g[j] for all j ▷ expected share of Q[j], divided by n
  11. 10return Q, s and ℓ = Σ_i log D[i]

Line L9 is the E step and the M step at once: sjαij/Dis_j \alpha_{ij}/D_i is the conditional probability that Ti∈QjT_i \in Q_j given Ti∈IiT_i \in I_i, the sum over ii is the expected number of times in QjQ_j, and dividing by nn is the complete-data MLE. The new masses sum to 1 because ∑jsjgj=1n∑iDi/Di=1\sum_j s_j g_j = \frac1n \sum_i D_i/D_i = 1; the code renormalizes with math.fsum against rounding drift. The stopping rule of line L8 certifies the result: ℓ(s^)−ℓ(s)≤n(max⁡jgj−1)\ell(\hat s) - \ell(s) \le n(\max_j g_j - 1) for the maximizer s^\hat s, so the returned log-likelihood is within nεn\varepsilon of the maximum. A second function returns the lower and upper value of S^(t)\hat S(t), which differ only for tt inside an innermost interval of positive width.

Example

Six patients are checked for a condition at irregular visits. Two were negative at week 1 and positive at week 5, one negative at 2 and positive at 7, one had a known onset at week 3, one was negative at 3 and positive at 6, and one negative at 5 and positive at 6: (1,5],(1,5],(2,7],{3},(3,6],(5,6](1, 5], (1, 5], (2, 7], \{3\}, (3, 6], (5, 6].

Sorted endpoints, with L\mathrm L and R\mathrm R marking left and right ends: 1L,1L,2L,3Lexact,3R,3L,5R,5R,5L,6R,6R,7R1\mathrm L, 1\mathrm L, 2\mathrm L, 3\mathrm L_{\text{exact}}, 3\mathrm R, 3\mathrm L, 5\mathrm R, 5\mathrm R, 5\mathrm L, 6\mathrm R, 6\mathrm R, 7\mathrm R. The adjacent pairs L R\mathrm L\,\mathrm R give Q1={3}Q_1 = \{3\}, Q2=(3,5]Q_2 = (3, 5] and Q3=(5,6]Q_3 = (5, 6]. Their inclusion pattern is:

observation Q1={3}Q_1 = \{3\} Q2=(3,5]Q_2 = (3, 5] Q3=(5,6]Q_3 = (5, 6]
(1,5](1, 5], twice 1 1 0
(2,7](2, 7] 1 1 1
{3}\{3\} 1 0 0
(3,6](3, 6] 0 1 1
(5,6](5, 6] 0 0 1

From s=(1/3,1/3,1/3)s = (1/3, 1/3, 1/3), the DiD_i are 2/3,2/3,1,1/3,2/3,1/32/3, 2/3, 1, 1/3, 2/3, 1/3, so g1=16(32+32+1+3)=76g_1 = \frac16(\frac32 + \frac32 + 1 + 3) = \frac76 and g2=g3=1112g_2 = g_3 = \frac{11}{12}, and the first step gives s=(7/18,11/36,11/36)s = (7/18, 11/36, 11/36). The iteration converges to s^=(1/2,1/6,1/3)\hat s = (1/2, 1/6, 1/3): at this point D=(2/3,2/3,1,1/2,1/2,1/3)D = (2/3, 2/3, 1, 1/2, 1/2, 1/3) and g1=g2=g3=1g_1 = g_2 = g_3 = 1, so the Kuhn-Tucker conditions hold and ℓ=2log⁡23+2log⁡12+log⁡13=−3.29584\ell = 2\log\frac23 + 2\log\frac12 + \log\frac13 = -3.29584. From the uniform start it took 77, 133 and 189 iterations to reach ε=10−6\varepsilon = 10^{-6}, 10−910^{-9} and 10−1210^{-12}: linear convergence, about 56 iterations per factor 1000.

The estimate is S^(t)=1\hat S(t) = 1 for t<3t < 3, S^(3)=1/2\hat S(3) = 1/2, S^(5)=1/3\hat S(5) = 1/3 and S^(t)=0\hat S(t) = 0 for t≥6t \ge 6. For 3<t<53 < t < 5 it is anywhere in [1/3,1/2][1/3, 1/2], and for 5<t<65 < t < 6 in [0,1/3][0, 1/3]: the data do not say how the mass is spread inside (3,5](3, 5] and (5,6](5, 6]. No mass lies in (1,3)(1, 3), although three windows meet it, because each of them also contains {3}\{3\}, where the exact time needs mass.

Correctness

The proof in proofs/correctness.md shows that lines L1 and L2 find exactly the innermost intervals, and that for every point xx some innermost interval lies in every observation that contains xx, so a maximizer of L\mathcal L exists with all its mass on the QjQ_j. It proves the Kuhn-Tucker characterization, s^\hat s is optimal if and only if gj(s^)≤1g_j(\hat s) \le 1 for all jj with equality where s^j>0\hat s_j > 0, and the certificate ℓ(s^)−ℓ(s)≤n(max⁡jgj(s)−1)\ell(\hat s) - \ell(s) \le n(\max_j g_j(s) - 1) used by line L8. It shows that each step of line L9 increases ℓ\ell by at least nn times the Kullback-Leibler divergence between the new and the old masses, and that from the uniform start ℓ(s^)−ℓ(s(k))≤nlog⁡m/(k+1)\ell(\hat s) - \ell(s^{(k)}) \le n \log m/(k + 1) after kk steps, so the loop ends. Finally, the values Di(s^)D_i(\hat s) are the same for every maximizer.

Proof: The innermost intervals carry a maximizer, the Kuhn-Tucker gap certifies the fit, and the self-consistency iteration increases the likelihood with a gap below n log m over kfull

Let the observations be Ii=(Li,Ri]I_i = (L_i, R_i] for Li<RiL_i < R_i and Ii={Li}I_i = \{L_i\} for Li=RiL_i = R_i, i=1,…,ni = 1, \ldots, n, with Ri=∞R_i = \infty allowed.

The innermost intervals

Keys. Give each endpoint a key: (Li,0)(L_i, 0) for the left end of an exact time, (Ri,1)(R_i, 1) for a right end, (Li,2)(L_i, 2) for any other left end; and give each real point xx the key κ(x)=(x,12)\kappa(x) = (x, \tfrac12). Keys are compared lexicographically, which is the order of line L1. Then

x∈Ii  ⟺  key(Li)<κ(x)<key(Ri).x \in I_i \iff \mathrm{key}(L_i) < \kappa(x) < \mathrm{key}(R_i).

For Li<RiL_i < R_i: (Li,2)<(x,12)(L_i, 2) < (x, \tfrac12) holds exactly when Li<xL_i < x, and (x,12)<(Ri,1)(x, \tfrac12) < (R_i, 1) exactly when x≤Rix \le R_i. For Li=Ri=yL_i = R_i = y: (y,0)<(x,12)<(y,1)(y, 0) < (x, \tfrac12) < (y, 1) holds exactly when x=yx = y. So every observation is the set of points whose keys lie strictly between its two endpoint keys, and the problem becomes one about intervals on a line of keys. No left key equals a right key, since their second components differ.

A pair of positions k,k+1k, k + 1 in the sorted list with a left end at kk and a right end at k+1k + 1 defines Q={x:keyk<κ(x)<keyk+1}Q = \{x : \mathrm{key}_k < \kappa(x) < \mathrm{key}_{k+1}\}. If the left end is open with value pp and the right end has value qq, this is (p,q](p, q], nonempty because a right end with value pp sorts before (p,2)(p, 2), so q>pq > p. If the left end is the exact time pp, its own right end (p,1)(p, 1) is the first right key after (p,0)(p, 0), so q=pq = p and Q={p}Q = \{p\}. These are the regions of line L2.

Lemma 1 (each region is inside or outside each observation). For every region QjQ_j and every ii, either Qj⊆IiQ_j \subseteq I_i or Qj∩Ii=∅Q_j \cap I_i = \emptyset, and Qj⊆IiQ_j \subseteq I_i if and only if key(Li)≤keyk\mathrm{key}(L_i) \le \mathrm{key}_k and keyk+1≤key(Ri)\mathrm{key}_{k+1} \le \mathrm{key}(R_i). The regions are pairwise disjoint, and m≤nm \le n.

Proof. No endpoint key lies strictly between keyk\mathrm{key}_k and keyk+1\mathrm{key}_{k+1}, since they are adjacent. So each of key(Li)<key(Ri)\mathrm{key}(L_i) < \mathrm{key}(R_i) is at most keyk\mathrm{key}_k or at least keyk+1\mathrm{key}_{k+1}. If both are at most keyk\mathrm{key}_k or both at least keyk+1\mathrm{key}_{k+1}, then IiI_i and QjQ_j are disjoint; otherwise key(Li)≤keyk\mathrm{key}(L_i) \le \mathrm{key}_k and keyk+1≤key(Ri)\mathrm{key}_{k+1} \le \mathrm{key}(R_i), and Qj⊆IiQ_j \subseteq I_i. This is the test of the function contains. Two pairs cannot share a position, since position k+1k + 1 of one pair holds a right end and cannot be the left end of another, so the key ranges and hence the regions are disjoint. Each pair uses a different left end, so m≤nm \le n. □\square

Lemma 2 (every point is dominated by a region). For a point xx let Σ(x)={i:x∈Ii}\Sigma(x) = \{i : x \in I_i\}, and for a region let Σ(Qj)={i:Qj⊆Ii}\Sigma(Q_j) = \{i : Q_j \subseteq I_i\}. For every xx there is a jj with Σ(Qj)⊇Σ(x)\Sigma(Q_j) \supseteq \Sigma(x). In particular every observation contains a region.

Proof. If Σ(x)\Sigma(x) is empty, any jj works. Otherwise let AA be the largest left key and BB the smallest right key among the observations in Σ(x)\Sigma(x). Then A<κ(x)<BA < \kappa(x) < B, so AA comes before BB in the sorted list. The stretch of the list from AA to BB starts with a left end and ends with a right end, so somewhere in it a left end is directly followed by a right end. That pair gives a region QjQ_j with A≤keyk<keyk+1≤BA \le \mathrm{key}_k < \mathrm{key}_{k+1} \le B, and by Lemma 1, Qj⊆IiQ_j \subseteq I_i for every i∈Σ(x)i \in \Sigma(x). For the last statement take any x∈Iix \in I_i; then i∈Σ(x)i \in \Sigma(x), so the region found lies in IiI_i. □\square

Claim 1 (reduction to the regions). For every distribution FF of TT there are masses s∈Δms \in \Delta_m with Di(s)≥PF(T∈Ii)D_i(s) \ge P_F(T \in I_i) for all ii, where Di(s)=∑jαijsjD_i(s) = \sum_j \alpha_{ij} s_j. Every distribution that gives mass sjs_j to QjQ_j has P(T∈Ii)=Di(s)P(T \in I_i) = D_i(s), however it spreads the mass inside each QjQ_j. Hence sup⁡FL(F)=max⁡s∈Δm∏iDi(s)\sup_F \mathcal L(F) = \max_{s \in \Delta_m} \prod_i D_i(s), and a maximizing ss gives the NPMLE.

Proof. The sets Σ(x)\Sigma(x) change only at endpoints, so the line splits into finitely many intervals on which Σ\Sigma is constant. Choose for each xx the smallest j(x)j(x) given by Lemma 2; it is constant on those intervals, so x↦j(x)x \mapsto j(x) is measurable. Let sj=PF(j(T)=j)s_j = P_F(j(T) = j). If x∈Iix \in I_i and j(x)=jj(x) = j then i∈Σ(x)⊆Σ(Qj)i \in \Sigma(x) \subseteq \Sigma(Q_j), so αij=1\alpha_{ij} = 1, and

PF(T∈Ii)=∑jPF(T∈Ii, j(T)=j)≤∑jαijsj=Di(s).P_F(T \in I_i) = \sum_j P_F(T \in I_i,\ j(T) = j) \le \sum_j \alpha_{ij} s_j = D_i(s).

The second statement follows from Lemma 1: each QjQ_j lies entirely inside or outside IiI_i. □\square

The maximum exists: ℓ(s)=∑ilog⁡Di(s)\ell(s) = \sum_i \log D_i(s) is continuous from the compact simplex to [−∞,∞)[-\infty, \infty), and it is finite at the uniform point because every observation contains a region, so Di≥1/mD_i \ge 1/m.

Optimality and the certificate

For ss with every Di(s)>0D_i(s) > 0, ∂ℓ/∂sj=∑iαij/Di(s)=n gj(s)\partial \ell/\partial s_j = \sum_i \alpha_{ij}/D_i(s) = n\, g_j(s), and

∑jsj gj(s)=1n∑i∑jαijsjDi(s)=1.(1)\sum_j s_j\, g_j(s) = \frac1n \sum_i \frac{\sum_j \alpha_{ij} s_j}{D_i(s)} = 1. \tag{1}

Claim 2 (certificate). For every such ss and every s′∈Δms' \in \Delta_m, ℓ(s′)≤ℓ(s)+n(max⁡jgj(s)−1)\ell(s') \le \ell(s) + n(\max_j g_j(s) - 1).

Proof. ℓ\ell is concave, a sum of logarithms of linear functions, so it lies below its tangent plane: ℓ(s′)≤ℓ(s)+∑jngj(s)(sj′−sj)=ℓ(s)+n(∑jsj′gj(s)−1)\ell(s') \le \ell(s) + \sum_j n g_j(s)(s'_j - s_j) = \ell(s) + n(\sum_j s'_j g_j(s) - 1) by (1), and ∑jsj′gj(s)≤max⁡jgj(s)\sum_j s'_j g_j(s) \le \max_j g_j(s) because s′s' is a probability vector. □\square

So when line L8 exits, the returned ℓ\ell is within nεn\varepsilon of the maximum.

Claim 3 (Kuhn-Tucker conditions). s^\hat s maximizes ℓ\ell over Δm\Delta_m if and only if gj(s^)≤1g_j(\hat s) \le 1 for every jj. Then gj(s^)=1g_j(\hat s) = 1 wherever s^j>0\hat s_j > 0.

Proof. If all gj(s^)≤1g_j(\hat s) \le 1, Claim 2 gives ℓ(s′)≤ℓ(s^)\ell(s') \le \ell(\hat s) for all s′s'. Conversely, if gj(s^)>1g_j(\hat s) > 1 for some jj, the direction ej−s^e_j - \hat s stays in the simplex for small steps, and the derivative of ℓ\ell along it is n(gj(s^)−∑ls^lgl(s^))=n(gj(s^)−1)>0n(g_j(\hat s) - \sum_l \hat s_l g_l(\hat s)) = n(g_j(\hat s) - 1) > 0, so s^\hat s is not a maximizer. When all gj≤1g_j \le 1, (1) is a weighted average of the gjg_j with weights s^j\hat s_j that equals 1, so every gjg_j with s^j>0\hat s_j > 0 equals 1. □\square

Claim 4 (uniqueness of the fitted probabilities). All maximizers have the same vector (D1(s^),…,Dn(s^))(D_1(\hat s), \ldots, D_n(\hat s)).

Proof. If two maximizers s^\hat s and s~\tilde s had different vectors, their midpoint would satisfy ℓ(12(s^+s~))=∑ilog⁡12(Di(s^)+Di(s~))>∑i12(log⁡Di(s^)+log⁡Di(s~))=max⁡ℓ\ell(\tfrac12(\hat s + \tilde s)) = \sum_i \log \tfrac12(D_i(\hat s) + D_i(\tilde s)) > \sum_i \tfrac12(\log D_i(\hat s) + \log D_i(\tilde s)) = \max \ell, by strict concavity of log⁡\log on the coordinates where they differ. □\square

The iteration

Line L9 maps ss to s′s' with sj′=sjgj(s)s'_j = s_j g_j(s). By (1), s′∈Δms' \in \Delta_m. Every region lies in the observation whose left end defines it, so gj(s)>0g_j(s) > 0 whenever all Di(s)>0D_i(s) > 0; from the uniform start every iterate has all sj>0s_j > 0 and all Di>0D_i > 0.

Claim 5 (EM step). s′s' is one step of the EM algorithm for the complete data "the region that contains TiT_i".

Proof. Given Ti∈IiT_i \in I_i and masses ss, the probability that Ti∈QjT_i \in Q_j is αijsj/Di(s)\alpha_{ij} s_j/D_i(s). The E step gives the expected count μj=∑iαijsj/Di(s)=nsjgj(s)\mu_j = \sum_i \alpha_{ij} s_j/D_i(s) = n s_j g_j(s) in QjQ_j, and the M step, the multinomial MLE from these counts, is μj/n=sj′\mu_j/n = s'_j. □\square

Claim 6 (ascent). ℓ(s′)−ℓ(s)≥n KL(s′ ∥ s)≥0\ell(s') - \ell(s) \ge n\, \mathrm{KL}(s' \,\|\, s) \ge 0, where KL(a ∥ b)=∑jajlog⁡(aj/bj)\mathrm{KL}(a \,\|\, b) = \sum_j a_j \log(a_j/b_j), with equality only if s′=ss' = s.

Proof. For each ii the weights wij=αijsj/Di(s)w_{ij} = \alpha_{ij} s_j/D_i(s) are non-negative and sum to 1 over jj, and Di(s′)/Di(s)=∑jwij gj(s)D_i(s')/D_i(s) = \sum_j w_{ij}\, g_j(s). By Jensen's inequality for the concave log⁡\log,

ℓ(s′)−ℓ(s)=∑ilog⁡∑jwij gj≥∑i∑jwijlog⁡gj=∑jnsj′log⁡gj=n∑jsj′log⁡sj′sj,\ell(s') - \ell(s) = \sum_i \log \sum_j w_{ij}\, g_j \ge \sum_i \sum_j w_{ij} \log g_j = \sum_j n s'_j \log g_j = n \sum_j s'_j \log \frac{s'_j}{s_j},

using ∑iwij=nsjgj=nsj′\sum_i w_{ij} = n s_j g_j = n s'_j. Gibbs' inequality gives KL≥0\mathrm{KL} \ge 0, with equality only for equal vectors. □\square

Claim 7 (rate). Let s^\hat s be a maximizer and s(0)s^{(0)} the uniform start. Then ℓ(s^)−ℓ(s(k))≤nlog⁡m/(k+1)\ell(\hat s) - \ell(s^{(k)}) \le n \log m/(k + 1) for every k≥0k \ge 0.

Proof. Fix ss with all sj>0s_j > 0 and Di(s)>0D_i(s) > 0, and let s′s' be its update. For jj with s^j>0\hat s_j > 0, Claim 3 gives gj(s^)=1g_j(\hat s) = 1, so uij=αij/(nDi(s^))u_{ij} = \alpha_{ij}/(n D_i(\hat s)) are weights summing to 1 over ii, and gj(s)=∑iuij Di(s^)/Di(s)g_j(s) = \sum_i u_{ij}\, D_i(\hat s)/D_i(s). By Jensen's inequality, log⁡gj(s)≥∑iuijlog⁡(Di(s^)/Di(s))\log g_j(s) \ge \sum_i u_{ij} \log(D_i(\hat s)/D_i(s)). Multiplying by s^j\hat s_j and summing over jj,

∑js^jlog⁡gj(s)≥∑i∑jαijs^jnDi(s^)log⁡Di(s^)Di(s)=ℓ(s^)−ℓ(s)n.\sum_j \hat s_j \log g_j(s) \ge \sum_i \frac{\sum_j \alpha_{ij} \hat s_j}{n D_i(\hat s)} \log \frac{D_i(\hat s)}{D_i(s)} = \frac{\ell(\hat s) - \ell(s)}{n}.

The left side is ∑js^jlog⁡(sj′/sj)=KL(s^ ∥ s)−KL(s^ ∥ s′)\sum_j \hat s_j \log(s'_j/s_j) = \mathrm{KL}(\hat s \,\|\, s) - \mathrm{KL}(\hat s \,\|\, s'). Summing over the steps s(0),…,s(k)s^{(0)}, \ldots, s^{(k)} telescopes:

∑r=0k(ℓ(s^)−ℓ(s(r)))≤n(KL(s^ ∥ s(0))−KL(s^ ∥ s(k+1)))≤n KL(s^ ∥ s(0))≤nlog⁡m,\sum_{r=0}^{k} \big(\ell(\hat s) - \ell(s^{(r)})\big) \le n\big(\mathrm{KL}(\hat s \,\|\, s^{(0)}) - \mathrm{KL}(\hat s \,\|\, s^{(k+1)})\big) \le n\, \mathrm{KL}(\hat s \,\|\, s^{(0)}) \le n \log m,

since KL(s^ ∥ uniform)=log⁡m−H(s^)≤log⁡m\mathrm{KL}(\hat s \,\|\, \text{uniform}) = \log m - H(\hat s) \le \log m. By Claim 6 the terms decrease in rr, so the last one is at most the average, nlog⁡m/(k+1)n \log m/(k + 1). □\square

Claim 8 (the loop ends). For every ε>0\varepsilon > 0, line L8 exits after finitely many iterations.

Proof. By Claim 7, ℓ(s(k))→max⁡ℓ\ell(s^{(k)}) \to \max \ell. Suppose max⁡jgj(s(k))>1+ε\max_j g_j(s^{(k)}) > 1 + \varepsilon for infinitely many kk. Those iterates have a convergent subsequence in the compact simplex, with limit sˉ\bar s. Since ℓ\ell is upper semicontinuous, ℓ(sˉ)≥lim⁡ℓ(s(k))=max⁡ℓ\ell(\bar s) \ge \lim \ell(s^{(k)}) = \max \ell, so sˉ\bar s is a maximizer and Di(sˉ)>0D_i(\bar s) > 0 for all ii. The gjg_j are continuous where all Di>0D_i > 0, so max⁡jgj(sˉ)≥1+ε\max_j g_j(\bar s) \ge 1 + \varepsilon, which contradicts Claim 3. □\square

The proved rate is sublinear, and the example on the algorithm page with a zero mass where gj=1g_j = 1 shows that the iteration can be that slow. The faster linear convergence seen in other examples is only measured.

Special cases. For exact and right-censored data the regions are the distinct event times and, when the largest time is censored, the interval beyond it; the maximizer of Claim 1 is then the Kaplan-Meier estimate, by the NPMLE theorem in the Kaplan-Meier correctness proof. For current status data the maximizer is the isotonic regression of the indicators (Ayer et al. 1955).

Cost

The sort in line L1 costs O(nlog⁡n)O(n \log n), line L2 one pass over 2n2n keys, and line L3 nmnm calls of contains, each O(1)O(1). Lines L6 and L7 cost O(∑i∣{j:αij=1}∣)=O(nm)O(\sum_i |\{j : \alpha_{ij} = 1\}|) = O(nm), and lines L8 and L9 cost O(m)O(m), per iteration. By Lemma 1 the regions inside IiI_i are those between two positions of the sorted list, a contiguous run ai..bia_i..b_i; with prefix sums Pj=s1+⋯+sjP_j = s_1 + \cdots + s_j, Di=Pbi−Pai−1D_i = P_{b_i} - P_{a_i - 1}, and gg is obtained by adding 1/Di1/D_i to a difference array at aia_i and subtracting it at bi+1b_i + 1, so an iteration costs O(n+m)O(n + m).

Complexity

The sort costs Θ(nlog⁡n)\Theta(n \log n). A left end followed directly by a right end can occur at most nn times, so m≤nm \le n. Line L3 tests all pairs, Θ(nm)\Theta(nm), and lines L6 and L7 cost Θ(∑i#{j:Qj⊆Ii})=O(nm)\Theta(\sum_i \#\{j : Q_j \subseteq I_i\}) = O(nm) per iteration. Since the QjQ_j are disjoint and ordered and each IiI_i is an interval, the QjQ_j inside IiI_i form a contiguous run ai..bia_i..b_i found by binary search. Then DiD_i is a difference of prefix sums of ss, and gg is a prefix sum of a difference array, so an iteration costs Θ(n+m)\Theta(n + m). The number kk of iterations dominates the cost. The bound nlog⁡m/(k+1)n \log m/(k + 1) on the likelihood gap is proved, but the linear rate of the example is only observed, and it fails when a Kuhn-Tucker condition holds with equality at a zero mass. For the sets (0,2],(1,3],(2,4],(3,∞](0, 2], (1, 3], (2, 4], (3, \infty] the maximizer is (1/2,0,1/2)(1/2, 0, 1/2) on (1,2],(2,3],(3,4](1, 2], (2, 3], (3, 4] with g2=1g_2 = 1. There the middle mass decays like 1/k1/k: 998, 31620 and 999980 iterations to reach ε=10−6\varepsilon = 10^{-6}, 10−910^{-9} and 10−1210^{-12}.

Measured on simulated data with visits at weeks 1 to 4, each attended with probability 0.6, TT exponential with rate 0.5, and ε=10−8\varepsilon = 10^{-8}: the median number of iterations was 36 (maximum 3747) for n=50n = 50, r=500r = 500, seed 1978, and 31 (maximum 58) for n=200n = 200, r=200r = 200, seed 1979. Current status data (one inspection per subject) can be much slower: of 10 simulated current status data sets with nn between 5 and 30 (seed 1955), one with n=21n = 21 needed 75444 iterations to reach ε=10−8\varepsilon = 10^{-8}, and the others at most 599.

Properties

  • Reduces to Kaplan-Meier. With only exact and right-censored times, the innermost intervals are the distinct event times plus the interval (c,∞](c, \infty] when the largest time cc is censored, and the NPMLE is the Kaplan-Meier estimator; its self-consistency equation is Efron's (1967).
  • Current status data. When each subject is inspected once at cic_i and only 1{Ti≤ci}1\{T_i \le c_i\} is seen, the NPMLE of FF at the inspection times is the isotonic regression of the indicators, computed in O(n)O(n) after sorting by pool adjacent violators (Ayer et al. 1955).
  • Partly unique. The probabilities Di(s^)D_i(\hat s) of the observed sets are unique. The masses sjs_j are unique under a rank condition on the matrix α\alpha (Gentleman and Geyer 1994), and the spread of each mass inside QjQ_j is never identified.
  • Slow statistical rate. Unlike Kaplan-Meier, the estimate is not n\sqrt n-consistent in general. For current status data F^(t)\hat F(t) converges at rate n1/3n^{1/3} with a non-normal limit (Groeneboom and Wellner 1992), so Greenwood-type standard errors do not apply. The bootstrap of the NPMLE is also unreliable in that case; inference on smooth functionals such as the mean is regular.
  • Not online, deterministic. All intervals are needed before the innermost intervals are known.

Measured accuracy against the simple fix of replacing each interval by its midpoint and running Kaplan-Meier, for the visit design above, true S(2)=e−1=0.3679S(2) = e^{-1} = 0.3679: the Turnbull estimate had bias +0.0009+0.0009 and root mean square error 0.0830.083 at n=50n = 50 (r=500r = 500, seed 1978), and bias −0.0001-0.0001, RMSE 0.0400.040 at n=200n = 200 (r=200r = 200, seed 1979). Midpoint imputation had bias −0.034-0.034 and −0.032-0.032, RMSE 0.0790.079 and 0.0470.047. Its bias does not shrink with nn.

Variants and improvements

  • Truncation. Turnbull's paper also covers left-truncated data, where subject ii is observed only if TiT_i lies in a set JiJ_i. The self-consistency equations then include the expected number of unobserved subjects, the "ghosts", whose times fall outside JiJ_i.
  • Iterative convex minorant and hybrid algorithms. Groeneboom and Wellner (1992) maximize over the distribution function with the iterative convex minorant algorithm, which treats the monotonicity constraint directly. Wellner and Zhan (1997) alternate EM steps and ICM steps, which is much faster when EM is slow.
  • Support reduction and Kuhn-Tucker pruning. Masses whose gjg_j stays below 1 can be set to zero and the problem solved on the remaining support, then checked with the Kuhn-Tucker conditions.
  • Smooth and parametric alternatives. A parametric model (Weibull or log-normal) fitted by maximum likelihood, or a spline or kernel-smoothed NPMLE, gives a unique curve inside the innermost intervals and n\sqrt n rates under its assumptions.
  • Bivariate and regression versions. The same EM step works for two-dimensional intervals (rectangles), and the semiparametric proportional hazards model for interval-censored data has an NPMLE of the baseline with the same structure.

When to use it

Use the Turnbull estimator for the survival curve whenever the event is detected at inspections rather than observed when it happens: onset of a disease found at screening visits, failure of equipment found at maintenance, seroconversion between blood tests. Report the estimate as steps over the innermost intervals, not as a continuous curve. For exact and right-censored data, Kaplan-Meier gives the same answer directly. Use the prefix-sum iteration or a hybrid EM-ICM solver for large nn, and always check the Kuhn-Tucker gap.

Pitfalls

  • Midpoint or right-endpoint imputation. Treating each interval as an exact time at its midpoint or right end and running Kaplan-Meier gives a biased curve, as measured above; using the right end systematically delays the events.
  • Stopping on small changes. EM can move very slowly, so a small change between iterations does not mean a near-optimal fit. Stop on the Kuhn-Tucker gap max⁡jgj−1\max_j g_j - 1, which bounds the likelihood gap.
  • Reading the curve inside an innermost interval. Any value between the two bounds is equally good. Plots that draw a straight line or a step at a chosen point inside QjQ_j add information that the data do not contain.
  • Open and closed ends. Whether a visit time belongs to the left or the right set changes the innermost intervals. With visits on a common schedule, use (Li,Ri](L_i, R_i] throughout, and represent an exact time as a point, not as (t−ϵ,t](t - \epsilon, t] with an arbitrary ϵ\epsilon.
  • Informative inspection. If visits become more frequent after symptoms start, the inspection process depends on TT, and the likelihood ∏iP(T∈Ii)\prod_i P(T \in I_i) is no longer correct.
  • Starting values with zeros. A mass started at 0 stays at 0 under line L9. Start every sjs_j positive.

Implementations

Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.

turnbull_estimator.pyI0RawGitHub
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/turnbull-estimator/. The authors are listed in prov/0DBRMH.jsonl.

import math
from collections.abc import Sequence
from typing import NamedTuple


class Region(NamedTuple):
    """An innermost interval: (left, right] if left_open, else the single point [left, left]."""

    left: float
    right: float
    left_open: bool


class TurnbullFit(NamedTuple):
    regions: list[Region]  # Q_1 < ... < Q_m, the innermost intervals
    mass: list[float]  # s_j, the probability of Q_j; sums to 1
    loglik: float  # sum over i of log P(T_i in I_i)
    kkt_gap: float  # max_j g_j - 1 >= 0; the log-likelihood is within n * kkt_gap of the maximum
    iterations: int


def _check(left, right):
    if len(left) == 0 or len(left) != len(right):
        raise ValueError("left and right must have the same positive length")
    for a, b in zip(left, right):
        if math.isnan(a) or math.isnan(b) or a > b or a == math.inf:
            raise ValueError("each observation needs left <= right and a finite left end")


def contains(region: Region, a: float, b: float) -> bool:
    """Whether the region lies inside the observation set: (a, b] if a < b, the point {a} if a == b."""
    if a == b:
        return not region.left_open and region.left == a
    if region.left_open:
        return a <= region.left and region.right <= b
    return a < region.left <= b


def innermost_intervals(left: Sequence[float], right: Sequence[float]) -> list[Region]:
    """Turnbull's innermost intervals of the sets (left_i, right_i], with exact times left_i == right_i."""
    _check(left, right)
    ends = []
    for a, b in zip(left, right):
        # At equal values: a closed left end (an exact time) first, then right ends, then open left ends.
        ends.append((a, 0 if a == b else 2, "L"))
        ends.append((b, 1, "R"))
    ends.sort()  # @line L1
    regions = []
    for (x, kx, sx), (y, _, sy) in zip(ends, ends[1:]):  # @line L2
        if sx == "L" and sy == "R":
            regions.append(Region(x, y, kx == 2))
    return regions


def turnbull(
    left: Sequence[float],
    right: Sequence[float],
    tol: float = 1e-9,
    max_iter: int = 1_000_000,
) -> TurnbullFit:
    """The NPMLE of the distribution of T from the sets T_i in (left_i, right_i].

    left_i == right_i is an exact time, right_i = inf a right censoring at left_i,
    left_i = 0 with T > 0 a left censoring at right_i. Self-consistency (EM)
    iterations run until max_j g_j <= 1 + tol, where g_j is (1/n) times the
    derivative of the log-likelihood in s_j; then the log-likelihood is within
    n * tol of its maximum. Cost per iteration: O(sum_i #{j : Q_j in I_i}).
    """
    regions = innermost_intervals(left, right)
    n, m = len(left), len(regions)
    cover = [[j for j in range(m) if contains(regions[j], a, b)] for a, b in zip(left, right)]  # @line L3
    s = [1.0 / m] * m  # @line L4
    it = 0
    while True:  # @line L5
        dens = [sum(s[j] for j in cover[i]) for i in range(n)]  # @line L6
        g = [0.0] * m  # @line L7
        for i in range(n):
            for j in cover[i]:
                g[j] += 1.0 / dens[i]
        g = [x / n for x in g]
        gap = max(g) - 1.0
        if gap <= tol or it >= max_iter:  # @line L8
            break
        s = [s[j] * g[j] for j in range(m)]  # @line L9
        total = math.fsum(s)  # equal to 1 up to rounding, since sum_j s_j g_j = 1
        s = [x / total for x in s]
        it += 1
    loglik = math.fsum(math.log(d) for d in dens)
    return TurnbullFit(regions, s, loglik, max(gap, 0.0), it)  # @line L10


def survival(fit: TurnbullFit, t: float) -> tuple[float, float]:
    """Bounds (lower, upper) of S(t) = P(T > t) over all NPMLEs with the fitted region masses.

    The two agree unless t falls inside a region of positive width, where the
    NPMLE does not say how the mass of the region is spread.
    """
    lo = hi = 0.0
    for q, w in zip(fit.regions, fit.mass):
        if q.left_open:
            if q.left >= t:
                lo += w
            if q.right > t:
                hi += w
        elif q.left > t:
            lo += w
            hi += w
    return lo, hi
test_turnbull_estimator.py 218 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/turnbull-estimator/. The authors are listed in prov/0DBRMH.jsonl.

import itertools
import math
import random
from fractions import Fraction

import pytest

from turnbull_estimator import Region, contains, innermost_intervals, survival, turnbull

INF = math.inf


def loglik(cells_of_obs, p):
    total = 0.0
    for cells in cells_of_obs:
        x = sum(p[c] for c in cells)
        if x <= 0:
            return -INF
        total += math.log(x)
    return total


def compositions(total, parts):
    """All tuples of `parts` non-negative integers that sum to `total`."""
    for bars in itertools.combinations(range(total + parts - 1), parts - 1):
        prev, out = -1, []
        for b in bars:
            out.append(b - prev - 1)
            prev = b
        out.append(total + parts - 2 - prev)
        yield out


def random_interval_data(rng, n):
    left, right = [], []
    for _ in range(n):
        a = rng.randint(0, 4)
        b = rng.choice([x for x in range(a + 1, 5)] + [INF])
        left.append(a)
        right.append(b)
    return left, right


def test_hand_example() -> None:
    # Sets (0,2], (1,3], (2,4], (3,inf): innermost intervals (1,2], (2,3], (3,4]. The
    # log-likelihood is log s1 + log(s1 + s2) + log(s2 + s3) + log s3, maximal at (1/2, 0, 1/2)
    # with value 4 log(1/2). The KKT condition holds with equality at the zero mass, g_2 = 1,
    # and there EM converges only sublinearly: s_2 is about 1/k after k iterations.
    fit = turnbull([0, 1, 2, 3], [2, 3, 4, INF], tol=1e-8)
    assert fit.regions == [Region(1, 2, True), Region(2, 3, True), Region(3, 4, True)]
    assert abs(fit.mass[0] - 0.5) < 1e-3 and abs(fit.mass[2] - 0.5) < 1e-3 and fit.mass[1] < 1e-3
    assert 4 * math.log(0.5) - 4 * fit.kkt_gap <= fit.loglik <= 4 * math.log(0.5)
    assert 1000 < fit.iterations
    lo, hi = survival(fit, 1)
    assert math.isclose(lo, 1.0) and math.isclose(hi, 1.0)
    lo, hi = survival(fit, 1.5)
    assert math.isclose(lo, 1 - fit.mass[0]) and math.isclose(hi, 1.0)


def test_against_brute_force_npmle_on_a_grid() -> None:
    # Endpoints in {0,...,4} or inf. The cells (0,1], ..., (3,4], (4,inf) carry the mass of any
    # distribution as far as the likelihood is concerned. The brute force tries every mass vector
    # on the simplex with step 1/16, 3876 vectors, without using the innermost intervals.
    rng = random.Random(1976)
    cells = [(k, k + 1) for k in range(4)] + [(4, INF)]
    for _ in range(6):
        left, right = random_interval_data(rng, rng.randint(4, 9))
        n = len(left)
        cells_of_obs = [[c for c, (u, v) in enumerate(cells) if a <= u and v <= b] for a, b in zip(left, right)]
        best = max(loglik(cells_of_obs, [k / 16 for k in comp]) for comp in compositions(16, 5))
        fit = turnbull(left, right, tol=1e-11)
        assert fit.loglik >= best - 1e-9  # the EM limit is at least as good as every grid point
        assert fit.loglik - best < 0.1  # and the grid comes close to it
        # The certified bound: no distribution beats the fit by more than n * kkt_gap.
        assert fit.kkt_gap <= 1e-11
        for _ in range(200):
            w = [rng.random() for _ in cells]
            tot = sum(w)
            assert loglik(cells_of_obs, [x / tot for x in w]) <= fit.loglik + n * fit.kkt_gap + 1e-12


def test_innermost_intervals_carry_every_signature() -> None:
    # Each point of the line has a signature, the set of observations that contain it.
    # Every signature is contained in the signature of some innermost interval, so moving
    # mass into the innermost intervals never lowers the likelihood.
    rng = random.Random(1955)
    for _ in range(100):
        n = rng.randint(1, 8)
        left, right = [], []
        for _ in range(n):
            a = rng.randint(0, 6)
            if rng.random() < 0.25:
                left.append(a)
                right.append(a)  # an exact time
            else:
                left.append(a)
                right.append(rng.choice([x for x in range(a + 1, 8)] + [INF]))
        regions = innermost_intervals(left, right)
        sig = [frozenset(i for i in range(n) if contains(q, left[i], right[i])) for q in regions]
        for i in range(n):
            assert any(i in s for s in sig)  # every observation contains an innermost interval
        points = [x / 2 for x in range(0, 20)]
        for x in points:
            s = frozenset(i for i in range(n) if (left[i] < x <= right[i]) or (left[i] == right[i] == x))
            assert any(s <= t for t in sig)
        for a, b in itertools.combinations(range(len(regions)), 2):
            assert not (sig[a] < sig[b] or sig[b] < sig[a])  # no region is dominated by another


def pav(values, weights):
    """Weighted isotonic (nondecreasing) regression by pool adjacent violators, in Fractions."""
    blocks = []  # [value, weight, count]
    for v, w in zip(values, weights):
        blocks.append([Fraction(v), Fraction(w), 1])
        while len(blocks) > 1 and blocks[-2][0] > blocks[-1][0]:
            v2, w2, c2 = blocks.pop()
            v1, w1, c1 = blocks.pop()
            blocks.append([(v1 * w1 + v2 * w2) / (w1 + w2), w1 + w2, c1 + c2])
    out = []
    for v, _, c in blocks:
        out.extend([v] * c)
    return out


def test_current_status_is_isotonic_regression() -> None:
    # Current status data: at time c_i only delta_i = 1{T_i <= c_i} is seen, so the set is
    # (0, c_i] or (c_i, inf). The NPMLE of F at the distinct c is the isotonic regression of
    # the delta, the mean of the delta at each c weighted by the count (Ayer et al. 1955).
    rng = random.Random(1955)
    for _ in range(10):
        n = rng.randint(5, 30)
        c = [rng.randint(1, 10) for _ in range(n)]
        t = [rng.expovariate(0.2) for _ in range(n)]
        delta = [1 if ti <= ci else 0 for ti, ci in zip(t, c)]
        left = [0 if d else ci for ci, d in zip(c, delta)]
        right = [ci if d else INF for ci, d in zip(c, delta)]
        xs = sorted(set(c))
        means = [Fraction(sum(d for ci, d in zip(c, delta) if ci == x), c.count(x)) for x in xs]
        f_hat = pav(means, [c.count(x) for x in xs])
        ll_pav = sum(math.log(f_hat[xs.index(ci)] if d else 1 - f_hat[xs.index(ci)]) for ci, d in zip(c, delta))
        fit = turnbull(left, right, tol=1e-9)
        assert ll_pav - n * fit.kkt_gap - 1e-12 <= fit.loglik <= ll_pav + 1e-12
        for x, f in zip(xs, f_hat):
            lo, hi = survival(fit, x)
            assert lo == hi  # S is determined at the observation times
            assert abs((1 - lo) - float(f)) < 1e-3


def kaplan_meier_exact(times, events):
    """S at each distinct time, by the product limit in Fractions."""
    s, out = Fraction(1), {}
    for t in sorted(set(times)):
        n = sum(1 for y in times if y >= t)
        d = sum(1 for y, e in zip(times, events) if y == t and e)
        s *= 1 - Fraction(d, n)
        out[t] = s
    return out


def test_exact_and_right_censored_data_give_kaplan_meier() -> None:
    rng = random.Random(1958)
    for _ in range(25):
        n = rng.randint(2, 25)
        times = [rng.randint(1, 12) for _ in range(n)]
        events = [1 if rng.random() < 0.6 else 0 for _ in range(n)]
        events[0] = 1
        left = list(times)
        right = [y if e else INF for y, e in zip(times, events)]
        fit = turnbull(left, right, tol=1e-12)
        km = kaplan_meier_exact(times, events)
        for t, s in km.items():
            lo, hi = survival(fit, t)
            assert math.isclose(lo, hi, abs_tol=1e-12)
            assert abs(lo - float(s)) < 1e-6


def test_exact_times_give_the_empirical_distribution() -> None:
    # Only exact times: the innermost intervals are the distinct times, the iteration stops
    # at once, and the masses are the empirical frequencies.
    rng = random.Random(1933)
    for _ in range(25):
        n = rng.randint(1, 30)
        times = [rng.randint(0, 9) for _ in range(n)]
        fit = turnbull(times, times, tol=1e-14)
        assert [q.left for q in fit.regions] == sorted(set(times))
        assert all(not q.left_open and q.left == q.right for q in fit.regions)
        for q, w in zip(fit.regions, fit.mass):
            assert math.isclose(w, float(Fraction(times.count(q.left), n)), rel_tol=1e-12)
        for t in range(-1, 11):
            lo, hi = survival(fit, t)
            assert lo == hi and math.isclose(lo, sum(1 for y in times if y > t) / n, abs_tol=1e-12)


def test_self_consistency_at_the_limit() -> None:
    # Turnbull's equation: s_j = (1/n) sum_i alpha_ij s_j / sum_l alpha_il s_l.
    rng = random.Random(7)
    left, right = random_interval_data(rng, 40)
    fit = turnbull(left, right, tol=1e-13)
    cover = [[j for j, q in enumerate(fit.regions) if contains(q, a, b)] for a, b in zip(left, right)]
    dens = [sum(fit.mass[j] for j in cov) for cov in cover]
    for j, s in enumerate(fit.mass):
        rhs = sum(s / dens[i] for i in range(len(left)) if j in cover[i]) / len(left)
        assert math.isclose(s, rhs, abs_tol=1e-12)
    assert math.isclose(math.fsum(fit.mass), 1.0, rel_tol=1e-14)


def test_rejects_bad_input() -> None:
    with pytest.raises(ValueError):
        turnbull([], [])
    with pytest.raises(ValueError):
        turnbull([2], [1])
    with pytest.raises(ValueError):
        turnbull([INF], [INF])
    with pytest.raises(ValueError):
        turnbull([1, 2], [3])

History

Ayer, Brunk, Ewing, Reid and Silverman (1955) found the NPMLE for current status data as an isotonic regression. Efron (1967) introduced self-consistency for right-censored data, and Peto (1973) defined the NPMLE for general interval-censored data, observed that its support lies in the intervals between a left end and the next right end, and maximized the likelihood numerically. Turnbull (1976) gave the innermost intervals for grouped, censored and truncated data together with the self-consistency algorithm, one year before Dempster, Laird and Rubin (1977) described the EM algorithm in general, of which it is an instance. Groeneboom and Wellner (1992) developed the asymptotic theory and the iterative convex minorant algorithm, and Gentleman and Geyer (1994) used the Kuhn-Tucker conditions to verify that a computed solution is the NPMLE and to study its uniqueness.

References

  1. Bruce W. Turnbull, The empirical distribution function with arbitrarily grouped, censored and truncated data, Journal of the Royal Statistical Society Series B 38(3), 1976, pp. 290 to 295 (the innermost intervals, the self-consistency equations and the iteration, with truncation)
  2. Richard Peto, Experimental survival curves for interval-censored data, Applied Statistics 22(1), 1973, pp. 86 to 91 (the NPMLE for interval-censored data and its support on the intervals between a left end and the next right end)
  3. Robert Gentleman and Charles J. Geyer, Maximum likelihood for interval censored data, consistency and computation, Biometrika 81(3), 1994, pp. 618 to 623 (the Kuhn-Tucker conditions as a check of the computed NPMLE, and its uniqueness)
  4. Miriam Ayer, H. D. Brunk, G. M. Ewing, W. T. Reid and Edward Silverman, An empirical distribution function for sampling with incomplete information, Annals of Mathematical Statistics 26(4), 1955, pp. 641 to 647 (the NPMLE for current status data as a monotone regression)
  5. John P. Klein and Melvin L. Moeschberger, Survival Analysis, Techniques for Censored and Truncated Data, 2nd edition, Springer, 2003, Chapter 5 (estimation of the survival function for other sampling schemes, including Turnbull's algorithm for interval-censored data)

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH1 sketch
  • a full proof of time.per_iteration
  • a full proof of time.per_iteration_prefix_sums
  • a full proof of time.setup
  • a full proof of time.total
  • a full proof of space.extra
  • a full proof of space.extra_prefix_sums
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
Code (python)I0 not checked yet
  • the tests did not run in this build
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • a scene preset for the example