Possible to use draws from two distributions to get draw from distribution with density their product? Suppose I have a set of draws from a distribution with density $f$ and a set of draws from a distribution with density $g$, where $f$ and $g$ are unknown. Is there some way to use these use these draws to get a (perhaps smaller) set of draws whose pdf is proportional to the product of the pdfs of these two distributions? 
I know it will be possible to get draws with approximately this distribution by kernel smoothing to estimate the two pdfs, but i was wondering if there was a way of getting draws with exactly the correct distribution.
 A: From a pure simulation point of view (Warning: link to my book), aiming at simulating from a product $f\times g$ of two (positive) functions such that $fg$ is integrable over the proper region suggests some specific methods:


*

*Sampling-importance-resampling: to apply when samples from both $f$ and $g$ can be produced and when the corresponding numerical values of the normalised versions of both $f$ and $g$ at those points can be numerically computed (resampling is not necessary for computing integrals related with $fg$).

*Accept-Reject: to apply when either $f$ or $g$ is proportional to a standard probability density, and the other term in the product is bounded.

*Slice sampling: to apply when either $f$ or $g$ is proportional to a standard probability density, easy to simulate, and the other function is such that the set $\{x; f(x)\ge a\}$ is easy to construct. Or when both $f$ and $g$ are such that $\{x; f(x)\ge a\}$ is easy to construct.

*Metropolis-Hastings algorithm: to apply when either $f$ or $g$ is proportional to a standard probability density, easy to simulate, and the other function can be (numerically) computed.

*Bridge sampling: to apply when both $f$ and $g$ are proportional to a standard probability density, when samples from both $f$ and $g$ can be produced in a reasonable time, and when the corresponding numerical values of both $f$ and $g$ at those points can be (numerically) computed.

*Nested sampling: to apply when either $f$ or $g$ is proportional to a standard probability density, easy to simulate, and the other function can be (numerically) computed.


Those different solutions do not necessarily take into account the fact that $f$ is a prior density and $g$ is a likelihood. Actually, it is not necessarily the best possible decomposition of the product $fg$, because $f$ can be too flat or even improper, while $g$ is not necessarily integrable in the parameter.

Note: A similar question was asked on Cross Validation last year
  but did not attract any traffic. I added links to scalable Monte Carlo solutions
  on that page.

