Tutorials › Exam ASTAM - Advanced Short-Term Actuarial Mathematics › Mapping Uniforms Through Survival Functions

Exam ASTAM · Random Variate Generation · Tutorial 589 of 979

Mapping Uniforms Through Survival Functions

Transform a uniform random number into a loss by finding where the target survival function first falls to that number or below.

Beginner 10 min read

What You'll Learn

  • Define the inverse survival rule using the generalized inverse of the target distribution.
  • Explain why the rule produces the target loss distribution.
  • Convert a survival-function calculation to an equivalent calculation using one minus the uniform draw.
  • Apply the rule to discrete, continuous, and mixed loss distributions.
  • Identify endpoint and atom-related traps when interpreting a survival-function crossing.

Why Map a Uniform Draw Through a Survival Function?

Simulation often begins with a pseudo-random number that is approximately uniform on the interval from 0 to 1. The modeling task is to turn that number into a loss with a specified probability distribution. When the model is described by its survival function, the useful question is: at what loss amount has the probability of exceeding that amount fallen to the uniform draw?

For a continuous distribution with a strictly decreasing survival function, this amounts to solving \(S_X(x)=U\). For discrete or mixed distributions, the survival function can jump or remain flat, so solving an equality may not work. The general rule uses the first point at which the survival function is at most the draw.

Definition: For a loss \(X\), the survival function is \(S_X(x)=P(X>x)=1-F_X(x)\). Define the generalized inverse of the survival function by $$ Q_S(u)=\inf\{x:S_X(x)\leq u\}, \qquad 0<u<1. $$ If \(U\) is uniform on \((0,1)\), then \(X^*=Q_S(U)\) has the same distribution as \(X\). Equivalently, \(X^*=F_X^{-1}(1-U)\), where \(F_X^{-1}(p)=\inf\{x:F_X(x)\geq p\}\).

The survival function here uses the strict-tail convention \(P(X>x)\). This convention matters at atoms: at a loss amount \(x\), the probability of a loss strictly greater than \(x\) excludes any probability mass at \(x\). The generalized inverse handles those jumps without requiring a continuous density or a unique solution to an equation.

Why the Transformation Has the Target Distribution

The survival rule is the CDF inverse rule in a different form. Since \(S_X(x)=1-F_X(x)\), for every \(x\) and \(u\), $$ S_X(x)\leq u \quad\Longleftrightarrow\quad F_X(x)\geq 1-u. $$ Consequently, the sets of loss amounts used to define the two infima are identical: $$ \inf\{x:S_X(x)\leq u\}=\inf\{x:F_X(x)\geq 1-u\}=F_X^{-1}(1-u). $$

Now \(1-U\) is also uniform on \((0,1)\). The generalized inverse transform says that applying \(F_X^{-1}\) to a uniform draw produces a random variable with CDF \(F_X\). Thus \(F_X^{-1}(1-U)\), and therefore \(Q_S(U)\), has the target distribution. This argument covers jumps and flat sections as well as smooth distributions.

A useful way to picture the result is that a uniform draw selects a probability level. The inverse survival rule moves from the low-loss end toward larger losses until the remaining tail probability is no greater than that selected level. With atoms, a range of uniform values maps to the same loss; the length of that range is exactly the atom's probability.

Implementation rule: Starting at the smallest possible loss, find the first \(x\) for which \(S_X(x)\leq U\). Use that \(x\) as the simulated loss. For a continuous strictly decreasing survival function, this is the solution of \(S_X(x)=U\). For a jump or flat section, use the generalized-inverse crossing rather than assuming an equality has a solution.

Worked Examples

Worked Example: Inverting a Discrete Loss Model

A hypothetical deductible-free contract has loss \(X\) equal to $0, $40, or $150, with probabilities 0.10, 0.60, and 0.30, respectively. A simulation produces \(U=0.25\). Use the survival inverse to generate a loss and verify the probability of that outcome.

Method. List the survival probabilities at the possible losses. At $0, \(S_X(0)=P(X>0)=0.60+0.30=0.90\). At $40, \(S_X(40)=P(X>40)=0.30\). At $150, \(S_X(150)=P(X>150)=0\).

The first possible loss where the survival is at most 0.25 is $150: the survival at $0 is 0.90, at $40 is 0.30, and at $150 is 0. Since 0.90 and 0.30 are both greater than 0.25, the generalized-inverse rule gives \(Q_S(0.25)=150\).

The equivalent CDF calculation uses \(1-U=0.75\). The CDF values are \(F_X(0)=0.10\), \(F_X(40)=0.70\), and \(F_X(150)=1.00\). The first loss whose CDF is at least 0.75 is $150. The probability of generating that loss is therefore \(P(X=150)=0.30\).

Check. The survival crossing and the CDF inverse both return $150, and the probability attached to that outcome is 0.30. A common mistake is to select $40 because its survival, 0.30, is close to 0.25; the rule requires survival to be at most the draw, not merely the closest value.

Worked Example: Inverting a Continuous Survival Function

A hypothetical loss has support from $0 to $120 and survival function \(S_X(x)=(1-x/120)^2\) for \(0\leq x\leq120\). A draw is \(U=0.5625\). Find the generated loss and verify it using the survival function and the equivalent CDF calculation.

Method. The survival function decreases continuously from 1 to 0 on the stated support. Set it equal to the draw: $$ (1-x/120)^2=0.5625. $$

On this support \(1-x/120\) is nonnegative, so take the nonnegative square root: $$ 1-x/120=\sqrt{0.5625}=0.75. $$ Thus \(x/120=0.25\), giving \(x=120(0.25)=\$30\).

Survival check. At $30, \(S_X(30)=(1-30/120)^2=(0.75)^2=0.5625\), equal to the draw. For the equivalent CDF method, \(1-U=0.4375\), and \(F_X(x)=1-(1-x/120)^2\). Setting \(F_X(x)=0.4375\) gives \((1-x/120)^2=0.5625\), again yielding $30.

The generated loss is $30. The equality method works here because the survival function is continuous and strictly decreasing in the interior of its support. A common mistake is to use \(U\) as the CDF probability, which would instead solve \(F_X(x)=0.5625\); the equivalent CDF probability for the survival draw is \(1-U=0.4375\).

Worked Example: A Mixed Loss With a Probability of Zero

A hypothetical policy has a 0.20 probability of no loss. With probability 0.80, its loss is uniformly distributed from $20 to $100. For a simulation draw \(U=0.75\), find the loss. Also determine the loss when \(U=0.90\), and explain how the atom at zero appears in the transformation.

Method. At zero, \(S_X(0)=P(X>0)=0.80\). Between $0 and $20 the survival remains 0.80. For \(20\leq x\leq100\), the probability of a positive loss exceeding \(x\) is $$ S_X(x)=0.80\frac{100-x}{100-20} =0.80\frac{100-x}{80}. $$ The survival at $100 is zero.

For \(U=0.75\), the crossing is in the interval from $20 to $100. Solve \(0.80(100-x)/80=0.75\). Since \(0.80/80=0.01\), this becomes \(0.01(100-x)=0.75\), so \(100-x=75\) and \(x=\$25\). Substitution gives \(S_X(25)=0.80(75/80)=0.75\), as required.

For \(U=0.90\), the first possible loss, zero, already satisfies \(S_X(0)=0.80\leq0.90\). The generated loss is therefore $0. In fact, every draw in the interval from 0.80 to 1 maps to zero (apart from endpoint conventions that do not affect the distribution). This interval has length 0.20, matching the probability of no loss.

Check. The two outputs are $25 for \(U=0.75\) and $0 for \(U=0.90\). The atom at zero is not generated by solving a continuous equation; it is generated by the entire range of uniform values for which the survival has already fallen to 0.80 at zero. Ignoring that jump would understate the probability of a zero loss.

Reading the Crossing Correctly

For a discrete model with ordered loss values \(x_1<x_2<\cdots\), the survival function is a step function. The draw maps to the first loss value where the step is at most \(U\). If \(x_j\) has probability \(p_j\), the corresponding interval of uniform draws has length \(p_j\). This follows because the survival drops by exactly \(p_j\) at \(x_j\): the probability mass at that point is the amount removed from the strict upper tail.

For a mixed model, the same principle applies to both parts. A continuous stretch of the survival function maps ranges of uniform values to varying loss amounts, while a jump maps a range of uniform values to one loss amount. Thus the inverse-survival method does not require choosing a separate transformation for each part of the distribution.

The use of \(1-U\) is exactly equivalent, not an approximation. It is often convenient when software or a hand calculation is already set up to invert a CDF. If \(V=1-U\), then \(V\) is uniform whenever \(U\) is uniform, and \(Q_S(U)=F_X^{-1}(V)\). Do not apply \(1-U\) and then also reverse the survival inequality; that would complement the draw twice.

1
State the target law.
Write the survival function \(S_X(x)=P(X>x)\), its support, and any atoms or jumps relevant to the calculation.
2
Use the draw as a tail probability.
For a draw \(U\), find the first loss \(x\) satisfying \(S_X(x)\leq U\). If using a CDF instead, use the probability level \(1-U\).
3
Verify the result.
Check the crossing condition and, when possible, confirm the equivalent generalized CDF inverse. For an atom, check that the uniform interval mapping to it has the correct probability length.

Common Exam Traps

  • Using the CDF level \(U\) rather than \(1-U\). A survival draw \(U\) corresponds to the CDF draw \(1-U\), not \(U\).
  • Choosing the closest survival value. The rule is to take the first loss where \(S_X(x)\leq U\). In a discrete model, the closest value can be on the wrong side of the required crossing.
  • Replacing a generalized inverse with an equality. A step function may never equal the draw, and a flat section may have many points with the same survival. The first-crossing definition resolves both cases.
  • Using the wrong survival convention at an atom. Here \(S_X(x)=P(X>x)\), not \(P(X\geq x)\). In particular, \(S_X(x)\) excludes probability at \(x\).
  • Forgetting the atom in a mixed model. A probability mass creates a range of uniform draws mapping to the same outcome; it is not represented by a continuous equation alone.
Key takeaway: Given \(U\sim\operatorname{Uniform}(0,1)\), generate the target loss with \(Q_S(U)=\inf\{x:S_X(x)\leq U\}\). This is the same transformation as \(F_X^{-1}(1-U)\), and the generalized inverse makes it valid for discrete, continuous, and mixed loss models.

Check Your Understanding

For each problem, apply the first-crossing rule and check the result against the specified distribution.

  1. A hypothetical loss is $5, $25, or $80 with probabilities 0.20, 0.50, and 0.30. For \(U=0.15\), find the simulated loss and state its probability. (Answer: $80; probability 0.30)
  2. A loss has support \(0\leq x\leq50\) and survival \(S_X(x)=(1-x/50)^3\). For \(U=0.512\), find the generated loss. (Answer: $10)
  3. A hypothetical loss is zero with probability 0.25; otherwise it is uniformly distributed from $10 to $50. Find the generated loss for \(U=0.90\) and for \(U=0.60\). (Answer: $0 for \(U=0.90\); $18 for \(U=0.60\))
  4. A discrete loss takes values $0, $100, and $300 with probabilities 0.10, 0.60, and 0.30. For \(U=0.40\), identify the loss using both the survival rule and the equivalent CDF probability. (Answer: $100)
  5. A loss has support \(0\leq x\leq200\) and survival \(S_X(x)=(1-x/200)^2\). For \(U=0.36\), calculate the loss and verify it by using \(F_X^{-1}(1-U)\). (Answer: $80)
Clinical Biostats