Solution (source code)

= Solution

Assume independent individuals and <independent censoring> conditional on their explanatory variables, with the <censoring> mechanism carrying no parameter $\theta$. A failure contributes its failure-time <probability density function> $f_i(x_i;\theta)$, while a censored observation contributes the <survival function> $F_i(x_i;\theta)$ because its failure time exceeds $x_i$. Terms from the <censoring> distribution then factor out of the survival-parameter <likelihood>. Thus the <survival likelihood> and its logarithm are
$$
L(\theta)\propto\prod_{i=1}^n f_i(x_i;\theta)^{v_i}F_i(x_i;\theta)^{1-v_i},
$$
$$
\boxed{\ell(\theta)=\sum_{i=1}^n\{v_i\log f_i(x_i;\theta)+(1-v_i)\log F_i(x_i;\theta)\}+\text{constant}.}
$$
The individual subscripts allow the same parameter vector to act through different <covariate> values.