Simulating Survival Functions
Overview
Intuition
{% t = S^{-1}(Probability) %}
Example
This example demonstrates a simple survival function. In this case, the event occurs with equal probability between times
0 and 2, and is guaranteed to occur. Then the inverse function is
{% S^{-1}(x) = 2 \times x %}
let inv = val=>2*val;
let value = Math.random();
let time = inv(value);
Try it!