Suppose I am given a CDF of a distribution, given by $F(x) \propto x + x^2 + x^4 + x^7$. How do I generate a random variable from this distribution?
2026-03-29 20:37:27.1774816647
Generating Random Variates from CDF
88 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
As clarinetist wrote, your CDF is not really well-defined. But I will go ahead and assume its support lies on an interval of the form $[0,a]$, i.e. $F(0)=0$ and $F(a)=1$. Then $F:[0,a] \to [0,1]$ is bijective (since it is a sum of monomial terms with coefficients equal to 1) and hence $F^{-1}$ is well-defined.
Now let $V \sim U[0,1]$ be a uniformly distributed random variable, then by the inverse probability integral transformation it holds that:
$$ F^{-1}(V) \sim F $$
In other words, you can generate your random variable $X$ as follows:
Step 1: Draw $V \sim U[0,1]$
Step 2: Let $X=F^{-1}(V)$ (e.g. by inverting $F$ numerically)