Hi All
This week I write about how to create a distribution with a specified hazard function.
“Crayon math” is what I call it when I have shape in my mind that I want to express as a function; i.e., draw the shape with math. This can happen a lot when there is empirical data but there is value to describing it parametrically. In particular, recall Kaplan-Meier curves, in many cases it is useful to describe them parametrically. While it is possible to use Cox Proportional Hazards as noted before proportional hazards considers the order of events not the time between them. Thus in cases where the goal is to estimate not only the relative hazard but the absolute hazard it can be necessary to use parametric survival regression (think a GLM). The problem is to do that a distribution must be specified. That is a parameterization has to be chosen.
The normal way to pick a distribution is to chose semi-arbitrarily from usual suspects (Exponential, Weibull, Gamma, truncated normal and log normal). Sadly this choice is commonly made either for mathematical convenience or laziness (i.e, that was one of the options in R).
To do a better job it is worth looking at the shape of the empirical hazard function (I will make a post about this in the future ) and then build a distribution that matches it.
An illustrative example:
Consider the hazard function shown in figure 2; it starts high and asymptotes down to a constant value exponentially (I know this because I cheated, i.e., it is simulated data) .

Figure 1: a hazard function that asymptotes down to a constant value.
Starting with the hazard function the goal is to get a distribution. As usual working backwards is far easier. Thus let
be the desired cumulative distribution. If it is assumed that
where
then the pdf is
. The result is then that the hazard function is
as
.
Thus in the example of Fig. 2 therefore
and
.
Clearly not all functions will work. The big restrictions are
(to ensure that
) and
(to ensure that
). In addition, the usual restriction that
is positive is required.
That is it for now.