0

I just have a quick question about calculating marginal distributions via importance sampling. Let's say I have a function, $p(x,y)$, which is two-dimensional. And, I wish to integrate out one dimension to get a marginal distribution. So, something along the lines of $p_x(x) = \int p(x,y) dy$.

Is this at all possible to do this with importance sampling? So, in some sense rewrite $\int p(x,y) dy $ as some expectation value? I.e.,

$$ \int p(x,y) \, dy = \int p(x,y) \frac{q(y)}{q(y)} dy \approx \frac{1}{N} \sum_{i=1}^{N} \frac{p(x_i,y_i)}{q(y_i)} \iff y_i \sim q(y)$$

The reason I'm stating it as an arbitrary function $p(x,y)$ rather than giving a specific analytical function is because my function is a neural network so it has no easily writable form, nor can you analytically integrate out a variable! And, the function $p(x,y)$ isn't separable into independent marginals, so, $p(x,y) \neq p_x(x) p_y(y)$. Hence why I'm asking if it's at all possible (and how) to calculate a marginal distribution from an arbitrary function!

Any help is appreciated and thank you in advance!

  • 1
    This is certainly possible, provided the ratio $p(x_i,y_i)/q(y_i)$ has a finite variance for all $i$'s. The question on the whole has been addressed in [this](https://stats.stackexchange.com/a/210196/7224), [this](https://stats.stackexchange.com/q/60172/7224), [this](https://stats.stackexchange.com/q/153777/7224) post and numerous others. The fact that $p(x,y)$ is not separable is not an issue (but the fact that it is obtained from a NN may cause problems about its integrability in $(x,y)$). – Xi'an Apr 29 '21 at 19:12

0 Answers0