I'm using Bayes to solve a clustering problem. After doing some calculations I end up with the need to obtain the ratio of two probabilities:
$$P(A)/P(B)$$
to be able to obtain $P(H|D)$. These probabilities are obtained by integration of two different 2D multivariate KDEs as explained in this answer:
$$P(A) = \iint_{x, y : \hat{f}(x, y) < \hat{f}(r_a, s_a)} \hat{f}(x,y)\,dx\,dy$$ $$P(B) = \iint_{x, y : \hat{g}(x, y) < \hat{g}(r_b, s_b)} \hat{g}(x,y)\,dx\,dy$$
where $\hat{f}(x, y)$ and $\hat{g}(x, y)$ are the KDEs and the integration is done for all points below the thresholds $\hat{f}(r_a, s_a)$ and $\hat{g}(r_b, s_b)$. Both KDEs use a Gaussian kernel. A representative image of a KDE similar to the ones I'm working with can be seen here: Integrating kernel density estimator in 2D.
I calculate the KDEs by means of a python
function stats.gaussian_kde, so I assume the following general form for it:
$$KDE(x,y) = \frac{1}{n} \sum_{i=1}^{n} -\frac{1}{2h^2} e^{-\frac{(x-x_i)^2 + (y-y_i)^2}{2h^2}}$$
where n
is the length of my array of points and h
is the bandwidth used.
The integrals above are calculated applying a Monte Carlo process which is quite computationally expensive. I've read somewhere (forgot where, sorry) that in cases like this it is possible to replace the ratio of probabilities by the ratio of PDFs (KDEs) evaluated at the threshold points to obtain equally valid results. I'm interested in this because computing the KDEs ratio is orders of magnitude faster than calculating the ratio of the integrals with MC.
So the question is reduced to the validity of this expression:
$$\frac{P(A)}{P(B)} = \frac{\hat{f}(r_a, s_a)}{\hat{g}(r_b, s_b)}$$
Under which circumstances, if any, can I say that this relation is true?
[fixed typo (EDIT)]
Add:
Here's basically the same question but made in a more mathematical form.
P(X)
which is what I'm trying to avoid calculate. Could you expand a bit on the relevance of that parameter? $\endgroup$