Counting-process martingale (source code)

= Counting-process martingale
{title2=$M(t)=N(t)-\int_0^t\lambda(u)\,du$}

If a <counting process> $N$ has predictable conditional intensity $\lambda$, subtracting its <compensator of a counting process> gives the associated martingale $M$. Conditional expected event increments and compensator increments agree, so their difference is conditionally centered. With the necessary integrability, $M$ is a mean-zero <martingale>; for a simple no-ties process its predictable quadratic variation is $\int_0^t\lambda(u)du$. A predictable weighted martingale integral has mean zero and variance determined by the square of its weights. In <survival analysis>, $\lambda=Yh$ produces the event-minus-expected representation used to derive the <Nelson–Aalen estimator>.