I read online that:
"The inverse CDF technique for generating a random sample uses the fact that a continuous CDF, F, is a one-to-one mapping of the domain of the CDF into the interval (0,1). Therefore, if U is a uniform random variable on (0,1), then X = F–1(U) has the distribution F."
From: Article
But I'm failig to undertand this, in the specific case that I have:
$\displaystyle F_{X}( x) =\frac{e^{x}}{1+e^{x}}$, and therefore $\displaystyle F^{-1}_{X}( x) =\log\frac{x}{1-x}$.
From the derativate I was able to get the PDF: $\displaystyle f_{X}( x) =\frac{e^{x}}{\left( 1+e^{x}\right)^{2}}$.
How are the two functions mapping one-to-one?
If I have a random point generator $\displaystyle U$ between $\displaystyle [ 0,1]$. How exactly should I be able to generate a random point in $\displaystyle f_{X}( x)$? This is what I'm not getting, like what should I do exactly, and why it works.
With $U\sim \mathcal{U}(0,1)$, you have $\log \frac{U}{1-U} \sim \mathrm{logistic}(0,1)$. That is, you generate $U$ from a uniform on unit interval, transform it according to $\log \frac{U}{1-U}$, to obtain a random draw from a standard logistic distribution.