I want to model the expected failure rate in a growing population.
Each individual has a high infant mortality (e.g.
So the failure rate (or hazard function) at time t,
H(t), is the density function divided by the survival function:
H(t) = pdf(t)/sf(t)
The complication is that at every timestep, I have many individuals in my population. They have different age, and therefore different expected failure rates, which is given by their hazard function
h(t). The expected failure rate of the population as a whole is a mix of these hazard functions. How do I compute that?
My first instinct was to sum up densities and survival functions individually, and then divide one by the other.
pdfs = numpy.zeros(max_time) sfs = numpy.zeros(max_time) for t in individual_start_times: ts = numpy.arange(max_time-t) pdfs[t:] += scipy.stats.weibull_min.pdf(ts, shape=0.5, scale=100) sfs[t:] += scipy.stats.weibull_min.sf(ts, shape=0.5, scale=100) hazard = pdfs/sfs
Does that make sense, or is that bogus? I'm struggling to verify this.