# Inverse Transformation Sampling with Gaussian

For inverse transform sampling, if you know the CDF of a probability distribution ($f_X$) that you want to sample, you can generate a uniform realization ($U$) from [0,1], and then according to the sampling theorem,

$CDF^{-1}(U) =f_X$

My question is that can you replace the $U$ (the sample comes from uniform distribution [0,1]) with a sample coming from a Gaussian distribution?

I asked this question because according to here, it says:

Any distribution in d dimensions can be generated by taking a set of d varaible that are normally distriuted and mapping them through a sufficiently complicated function (e.g, In one dimension, you can use the inverse cumulative distribution function (CDF) of the desired distribution composed with the CDF of a Gaussian. this is an extension of "inverse transform sampling". )

• Btw, please use relevant tags for your questions. Neither of the tags you used initially were relevant to it (sampling was partly relevant but if you check it's wiki, you'll see that it suggests the [random-generation] tag to be used instead).
– Tim
May 15, 2017 at 7:25

Yes you can, but it is not very efficient. If $X$ follows standard normal distribution, then

$$Y = F^{-1}_Y (\Phi(X))$$

follows the distribution described by cumulative distribution function $F_Y$, where $\Phi$ is standard normal CDF.

See also How does the inverse transform method work? and Help me understand the quantile (inverse CDF) function threads, and my answer in Efficiently sampling a thresholded Beta distribution with the discussion in comments relating to expensiveness of inverse transform sampling.

• Thanks for your reply. I am wondering why are you saying this is not efficient? Is there any place at which I can read more or check out the proof? Thanks! @Tim
– wrek
May 15, 2017 at 6:37
• Wrek because you can more easily obtain the same result via $F_Y^{-1}(U)$. To compute $X$ (which is normal) you must somehow generate random normals. This is typically several times more expensive in time than generating a uniform (say roughly twice, perhaps more, depending on exactly how you do it; very efficient approaches can do somewhat better than twice as long), and will be done by starting with a uniform. Then you transform it to uniform by computing $\Phi(X)$ (itself pretty expensive), at which point you've merely calculated a uniform again! ... ctd May 15, 2017 at 6:59
• ctd... Then you use the inverse cdf method in the usual way. The only way this is likely not to be a lot slower is if $F^{-1}(\Phi())$ "cancels out" in some sense to produce a simpler function than either alone. May 15, 2017 at 7:00
• @wrek as Glen_b said, first you need to generate normal samples and this can be expensive, moreover then you need to evaluate normal CDF and inverse CDF of desired distribution, so there are at least few, possibly expensive, functions to evaluate. (PS check links in my edit)
– Tim
May 15, 2017 at 7:22