1
$\begingroup$

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". )

$\endgroup$
  • $\begingroup$ 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). $\endgroup$ – Tim May 15 '17 at 7:25
4
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ 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 $\endgroup$ – wrek May 15 '17 at 6:37
  • 3
    $\begingroup$ 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 $\endgroup$ – Glen_b May 15 '17 at 6:59
  • 3
    $\begingroup$ 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. $\endgroup$ – Glen_b May 15 '17 at 7:00
  • $\begingroup$ @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) $\endgroup$ – Tim May 15 '17 at 7:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.