Survival likelihood (source code)

= Survival likelihood
{title2=$L(\theta)\propto\prod_i h_\theta(y_i)^{\delta_i}S_\theta(y_i)$}

For a continuous event time $T$ with <probability density function> $f_\theta$, <survival function> $S_\theta$ and <hazard function> $h_\theta=f_\theta/S_\theta$, <right censoring> records $Y=\min(T,C)$ and $\delta=\mathbf1_{\{T\le C\}}$. Suppose $T$ and $C$ are <conditionally independent> given the observed <covariates>, suppressed here. Write $g_\eta$ and $G_\eta$ for the censoring-time <probability density function> and <survival function>. The joint observed-data <likelihood contribution> is
$$
\{f_\theta(y)G_\eta(y)\}^{\delta}
\{S_\theta(y)g_\eta(y)\}^{1-\delta}
=h_\theta(y)^\delta S_\theta(y)
 G_\eta(y)^\delta g_\eta(y)^{1-\delta}.
$$
An event contributes its event-time <probability density function> times the <probability> of remaining uncensored until then. A censored observation contributes its censoring-time <probability density function> times the <probability> of remaining event-free until then.

If the censoring model has separate <parameters> $\eta$ with no constraints linking them to $\theta$, its factor can be omitted when maximizing over $\theta$. The event-model part for <independent> subjects is then
$$
L(\theta)\propto\prod_i h_\theta(y_i)^{\delta_i}S_\theta(y_i),\qquad
\ell(\theta)=\sum_i\{\delta_i\log h_\theta(y_i)-H_\theta(y_i)\},
$$
where $H_\theta$ is the <cumulative hazard function>. <Independent censoring> alone does not permit dropping a censoring term that itself contains the event-model <parameters>. The familiar event-versus-censoring formula is thus a factorization under an ignorable observation mechanism, rather than an unconditional rule for every missing event time.<Survival Models by Germán Rodríguez>[Section 7.2, equation (7.7)]{ref}