Survival functions and hazard rates
The question
A cooling fan’s failure rate changes over its first six hours. What fraction of fans will still be running at that point?
- 1 SeeDraw a changing failure rate.
- 2 TryCompare fans on two schedules.
- 3 ProveDerive the survival curve.
- 4 ApplyFind probabilities, rates, and a median.
Before you start · 3 quick checks on conditioning, area, and logarithms, about 3 min
Two ideas before you start
2 ideasSurvival asks who is still waiting
A uniform waiting time has a survival curve that falls linearly to zero.
Move the inspection time. The highlighted height is the chance the event is still ahead.
Exact definition
Let \(T\) be time from the start to an event, such as the first failure of a fan. Its survival function is \(S(t)=P(T\gt t)\). Its cumulative distribution function is \(F(t)=P(T\le t)=1-S(t)\).
The card uses a uniform waiting time. Probability on any subinterval is its length divided by the full interval length. The solid line shows the full survival curve through the end of the interval, after which it stays at zero.
A rate accumulates over time
The shaded area under a constant inflow rate is a rectangle.
A tank fills at a constant rate. The shaded area is how much water has flowed in by the chosen time.
Exact definition
For an inflow rate \(r(s)\) in liters per hour, the amount added in \(t\) hours is \(\int_0^t r(s)\,ds\) liters. For constant \(r\), this is the rectangle \(rt\). With a linearly changing rate on an interval, use the width times the average of the two endpoint rates.
The fundamental theorem of calculus connects the accumulating area and the instantaneous rate. If \(r\) is continuous, differentiating \(\int_0^t r(s)\,ds\) gives \(r(t)\).
Fine print: conditioning and time units
For events \(A\) and \(B\) with \(P(B)\gt0\), \(P(A\mid B)=P(A\cap B)/P(B)\). The conditioning event on this page is often that the fan is still running at an inspection. If the fan is still running at a later time, it was still running at the inspection. The intersection is the later survival event. This is the same restriction to a known event used in conditional expectation.
We model nonnegative continuous event times with densities. For a time \(t\) with \(S(t)\gt0\), the hazard \(h(t)\) is the limiting conditional event probability per unit of time, given no event by \(t\). A hazard measured per hour can exceed one per hour. The probability over an actual time interval is between zero and one.
Draw a fan’s hazard curve
- Set the hazard at each marked time. The editor joins your rates with straight segments and then holds the last rate constant.
- Press Run my curve to see how many fans the model expects to last and where simulated failures land.
- After the reveal, set all four rates equal and see what changes. You can keep editing or start over.
Each fan starts running at time zero and leaves the group at its first failure. All fans follow the hazard you draw. Think of the rate at each time as applying to the fans that have made it that far.
Your model and its simulated failures
Compare the sample frequencies with the model probabilities in the table. An interval can have a high hazard and few failures if few fans reach it. The sample varies around the model probabilities. The table counts every simulated fan once.
Write \(H(t)=\int_0^t h(s)\,ds\) for cumulative hazard, the total area under the hazard since time zero. Over each straight segment in the editor, add the area of a trapezoid. The survival curve uses \(S(t)=\exp(-H(t))\). Stage 3 derives this conversion.
How the simulation picks a failure time
For each fan the model draws an independent uniform number \(U\) between zero and one and computes \(E=-\ln(1-U)\). It reports the time when cumulative hazard reaches \(E\). In the ideal continuous model, \(P(E\gt x)=e^{-x}\) for \(x\ge0\). Thus \(P(T\gt t)=P(E\gt H(t))=e^{-H(t)}\). The final rate is positive, so the cumulative hazard keeps rising and every finite threshold is reached.
The code uses the same pseudorandom thresholds for each edit, so you can compare settings fan by fan. A higher cumulative hazard reaches a given threshold sooner if it is already higher at the original failure time.
Compare two operating schedules
- Check both questions to open the comparison.
- Set the two shift rates and check the survival readouts as you work through the goals.
Answer both questions to open the comparison.
Survival during two shifts
Goals
What the late-shift probability measures
For \(0\le a\le b\) and \(S(a)\gt0\), conditioning on reaching hour \(a\) gives \(P(T\gt b\mid T\gt a)=S(b)/S(a)\). In the hazard model, the areas before hour \(a\) cancel in the ratio. The only area left is the one between hours \(a\) and \(b\).
The two tiles for your plan use all the starting fans as their reference group. The conditional tile uses only fans that reach the end of the early shift. That is why changing the early rate can change both absolute survival values while leaving the conditional tile fixed when the late rate stays the same.
Turn a hazard into survival
Assumptions. Let \(T\) be a nonnegative, absolutely continuous event time with density \(f\). On the interval \([0,b]\), with \(b\gt0\), take \(f\) continuous and strictly positive, and assume \(S(b)\gt0\). Then \(S(0)=1\) and \(0\lt S(t)\lt1\) for \(0\lt t\le b\).
Conclusion. For \(0\le t\lt b\), the hazard is \(h(t)=f(t)/S(t)\). If \(H(t)=\int_0^t h(s)\,ds\), then
\[S(t)=e^{-H(t)}.\]For \(\Delta\gt0\), let \(p_t(\Delta)\) be the conditional probability \(P(t\lt T\le t+\Delta\mid T\gt t)\). The hazard is the right-hand limit of \(p_t(\Delta)/\Delta\) as \(\Delta\) decreases to zero. The survival identity extends to \(b\) by continuity from the left. The choices below concern \(0\lt t\lt b\).
Choose the true equation for the stated assumptions. The explanation under each accepted line gives the step used to reach it.
Piecewise rates and proportional hazards
A nonnegative piecewise continuous hazard can include flat stretches at zero or jumps at switch times. Integrate on the continuous pieces and add their areas. Survival stays continuous at a jump when there is no atom there. If the cumulative hazard grows without bound, survival tends to zero, as a finite event time requires.
Suppose two groups share the same time origin and their hazards satisfy \(h_B(t)=c\,h_A(t)\) for a fixed \(c\gt0\) throughout the interval. Then \(H_B(t)=cH_A(t)\) and \(S_B(t)=S_A(t)^c\). The constant multiplies the rate and its area. The survival probability changes by taking a power.
From rates to event probabilities
Enter a decimal for each problem. Use hours where requested and probabilities on the zero-to-one scale. Open a hint if you need the first step. Each problem uses the stated model for a single event time.
Further reading
- J. P. Klein and M. L. Moeschberger, Survival Analysis: Techniques for Censored and Truncated Data.
- D. R. Cox, Regression Models and Life-Tables, Journal of the Royal Statistical Society, Series B.