Solution (source code)

= Solution

Let $N(t)$ count observed failures and let $Y(t)$ be the <at-risk process>, counting subjects under observation and still alive immediately before $t$. Under <independent censoring>, a short interval of length $dt$ has conditional expected failure count $Y(t)h(t)\,dt=Y(t)\,dH(t)$. The estimating equation obtained by replacing the count expectation by its observation is $d\widehat H(t)=dN(t)/Y(t)$. Each distinct failure gives $\Delta N(a_m)=1$ and $Y(a_m)=r_m$, so the <Nelson–Aalen estimator> is
$$
\boxed{\widehat H_{\rm NA}(t)=\sum_{a_m\le t}\frac1{r_m}.}
$$
The same increment maximizes the local working <likelihood> for a <Poisson distribution> with mean $r_m\Delta H_m$: differentiating $\Delta N_m\log(\Delta H_m)-r_m\Delta H_m$ gives $\Delta H_m=\Delta N_m/r_m$. The counting-process derivation explains why the <risk set>, rather than the initial sample size, supplies the denominator.