Solution (source code)

= Solution

Under independent <right censoring>, observation $(x_i,d_i)$ contributes
$$
f(x_i;\eta)^{d_i}S(x_i;\eta)^{1-d_i}
=h(x_i;\eta)^{d_i}S(x_i;\eta),
$$
where $d_i$ indicates an event. Multiply these contributions, take the <log-likelihood>, and maximize it over the parametric survival-model parameter $\eta$, numerically if the score equations have no closed form.