SemiParametric/Cox Proportional Hazard models
Cox Proportional Hazard model
Hazard function's formula
When it comes to predicting the survival function for a specific unit, the Cox Proportional Hazard Model (CoxPH) is usually the goto model. The CoxPH model is a semiparametric model that focuses on modeling the hazard function , by assuming that its time component and feature component are proportional such that: with:

, is the baseline function, which is usually not specified.

, is the risk function usually expressed via a linear representation such that . are the coefficients to determine
Building the model
The model can be built by calculating the Efron's partial likelihood to take ties into account. The partial likelihood can be written such that:

the log partial likelihood is

the gradient is

the Hessian matrix is
We can now use the NewtonOptimization schema to fit the model:
with:
 ,
DeepSurv/NonLinear CoxPH model
Hazard function's formula
The NonLinear CoxPH model was popularized by Katzman et al. in DeepSurv: Personalized Treatment Recommender System Using A Cox Proportional Hazards Deep Neural Network by allowing the use of Neural Networks within the original design. Here the hazard function can be written as
with:
 , where is a nonlinear risk function.
Building the model
We are still using the Efron's partial likelihood to take ties into account, but here the hazard function is . Thus, the log partial likelihood is
As the Hessian matrix will be too complicated to calculate, we will use PyTorch
to compute the gradient and perform a FirstOrder optimization.
References
 Wikipedia  Proportional hazards model
 Cox, David R. "Regression models and lifeātables." Journal of the Royal Statistical Society: Series B (Methodological) 34.2 (1972): 187202.
 Katzman, Jared, et al. "DeepSurv: Personalized treatment recommender system using A Cox proportional hazards deep neural network." arXiv preprint arXiv:1606.00931 (2016).