Modeling with Survival Function

    What the survival function is

    The survival function tells you the probability that something happens at least a certain number of times. You can also read it the other way: the chance that something lasts past a given point. That is where the name comes from. Say you are tracking how long a machine part keeps running. The survival function answers a simple question: what is the chance it is still going after this many hours?

    People often write it as SF(X). For example, SF(X = 3) is the probability that the event happens 3 or more times. The bigger the number you ask about, the smaller that probability gets. Asking for more is always harder to reach. If you want the exact math, the formal definition is on Wikipedia, but the plain idea above is all you need to model with it here.

    Mathematical definition of the survival function S(t) as P(T greater than t), equivalent to 1 minus the cumulative distribution function F(t).
    Mathematical definition of the survival function S(t) as P(T greater than t), equivalent to 1 minus the cumulative distribution function F(t).

    A real-life example

    Sometimes it is easier to think in terms of the survival function than to think about the chance of each exact outcome. Here is an everyday case.

    Say you are trying to decide whether to buy a monthly gym membership. You do not really enjoy the gym, but you want to lose some weight, so you are pushing yourself to start. The honest truth is that even with a membership you might not go very often. And if you only show up now and then, paying per visit could be cheaper than paying for the whole month. So before you spend the money, it helps to get a sense of how many times you will really go. How do you put a number on that?

    You ask yourself a few simple questions, and the answers become your survival function table.

    Will I go to the gym at least 1 time? Of course. You are certain you will go at least once, so there is no doubt here:

    SF(X = 1) = 1

    Will I go at least 2 times? Probably, yes, but you are not 100% sure anymore. Maybe 99% sure:

    SF(X = 2) = 0.99

    Will I go at least 4 times? Still likely, but your confidence has dropped to about 70%:

    SF(X = 4) = 0.7

    Will I go at least 15 times? Maybe, but now you are only about 10% confident:

    SF(X = 15) = 0.1

    Will I go at least 25 times? No chance. You know you are not doing that, so:

    SF(X = 25) = 0

    Now you have five honest numbers. You enter them into the SF table like this:

    Survival Function table input for the gym membership example, showing the probability the user will visit the gym at least N times in a month, with the SF plot rendered alongside.
    Survival Function table input for the gym membership example, showing the probability the user will visit the gym at least N times in a month, with the SF plot rendered alongside.

    As soon as you enter the data, the program draws the survival function plot for you. You can switch between the PMF, CDF, SF, and hazard rate views at any time, so you are never stuck with one picture of the same data.

    Once your SF table is in, click the PMF button to see the Probability Mass Function. You do not have to compute anything yourself. The program works it out from the survival values you just typed in.

    Probability Mass Function automatically computed from the gym example's survival function, showing 15 visits per month as the most likely outcome.
    Probability Mass Function automatically computed from the gym example's survival function, showing 15 visits per month as the most likely outcome.

    Now you are looking at the Probability Mass Function (PMF). In this gym example, it shows that going 15 times has the highest probability. So now you have a realistic feel for how often you will actually show up.

    From here the decision is easy. Work out what 15 visits would cost if you paid per day, and compare that to the monthly fee. If paying daily for those 15 visits still costs more than the monthly membership, buy the monthly. If it costs less, just pay per visit. The numbers make the call for you.

    You must include a point where the survival value is 0

    Every survival function table needs one value of the random variable whose SF is 0. That is the point where you are sure the event will not go any further. In the gym example, that was "at least 25 times," with SF = 0.

    If you leave that out, the program cannot finish the distribution, and you will see this error: "There must be an event with SF=0". The fix is easy. Add a row for the count you are sure you will never reach, and set its SF to 0.

    Validation warning 'There must be an event with SF=0' shown by the Probability Distribution tool when a survival function table has no row whose SF value equals 0.
    Validation warning 'There must be an event with SF=0' shown by the Probability Distribution tool when a survival function table has no row whose SF value equals 0.

    The survival function only goes down, never up

    Think about the gym example one more time. Suppose you claimed you were more confident about going at least 2 times than about going at least 1 time.

    Comic-style WHAT sticker used as a visual aside on the page when raising the rhetorical question of what happens if a survival function increases.
    Comic-style WHAT sticker used as a visual aside on the page when raising the rhetorical question of what happens if a survival function increases.

    Does that make sense? No, it does not.

    You cannot be more sure of going at least 2 times than of going at least 1 time. Going twice already includes going once. Asking for more can never be easier than asking for less, so the confidence can only stay the same or drop as the number grows. A function that behaves this way is called a nonincreasing function, and the survival function is always one.

    In plain terms: pick any two values, a and b. If a is greater than b, then f(a) must be less than or equal to f(b). Bigger input, equal or smaller output.

    For your SF table, this means each row's survival value cannot be larger than the value in the row above it. The numbers should march downward, or stay level, but never climb back up.

    If a row breaks this rule, you will see this error: "SF is a Non-Increasing Function. Therefore, the Survival probability of a value cannot be greater than the Survival probability of its previous value.". To fix it, lower the offending value so it is no greater than the one before it.

    Validation error shown by the Probability Distribution tool when a survival function table contains an entry that breaks the non-increasing requirement.
    Validation error shown by the Probability Distribution tool when a survival function table contains an entry that breaks the non-increasing requirement.

    Last updated on Jan 7, 2026