Skip to content

Semi-Parametric/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 go-to model. The CoxPH model is a semi-parametric 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 Newton-Optimization schema to fit the model:


  • ,

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


  • , where is a non-linear 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 First-Order optimization.