I have recently began using pysurvival package, for standard Cox regression. Their CoxPHModel
predicts both the survival and the hazard functions, which I would naively expect to be related via
$$
h(t) = -\frac{d}{dt}\log S(t)
$$
However in practice I fail to establish the correspondence between the two: neither by numerically differentiating $S(t)$, nor by integrating $h(t)$. Perhaps, I miss some intricacies of this particular package or more general caveats of numerical procedures in the context of the Cox regression (e.g., those related to the finite sample size). I will appreciate the insights from those who have some experience with numerical Cox regression.
Update
There are at least two different non-parametric estimation procedures involved here: Kaplan-Meier estimator for the survival function, and Nelso-Aalen estimator for the (cumulative) hazard function. According to this document, the two procedures are not equivalent, and this could be the source of discrepancies that I observe. Still, I would appreciate deeper insights in whether/how these are implemented in numerical packages.