3
$\begingroup$

I have two binomial distributions A and B, and a number v. v must belong to either A or B. I would like to calculate the percentage chance v belongs to distribution B.

two binomial distributions

My initial, rather naive, approach is to look at the relative curve values at that point:

mean = series_a.mean()
std = series_a.std()
a_percent_likelyhood = st.norm.pdf(number, mean, std)

mean = series_b.mean()
std = series_b.std()
b_percent_likelyhood = st.norm.pdf(number, mean, std)

chance_of_b = b_percent_likelyhood / (b_percent_likelyhood + a_percent_likelyhood)

But as v gets further away from the two distributions, that result tends to a 50% likelyhood of belonging to B, whereas my feeling is that it should tend to 100% on the "side" of B's mean, and tend to 0% on the side of A's mean.

Is this approach indeed flawed, and if so what would be a good alternate solution?

$\endgroup$
2
  • $\begingroup$ This is not entirely clear, but if your a_percent_likelyhood is some likelihood function (but so its dependence on number v is unclear, v does not occur in your formulas ...) $\endgroup$ Commented Mar 19, 2020 at 20:48
  • $\begingroup$ Nope, density function magnitude is the height of a differential. One needs to compare areas of density functions, as only the area of the differential can be a probability. $\endgroup$
    – Carl
    Commented Apr 7, 2020 at 22:57

1 Answer 1

2
$\begingroup$

I assume you have the same $N$ for both distributions, but this is not that essential.

By Bayes's rule:

$p(a|v) = \frac{p(v|a)p(a)}{p(v|a)p(a) + p(v|b)p(b)}$

If we assume both distribution $a$ and $b$ were equally likely before we saw the data this becomes:

$p(a|v) = \frac{p(v|a)}{p(v|a) + p(v|b)}$

Exactly what $v$ you are referring to is not totally clear, but I'm guessing you would want to plug in the pmf of distribution $a$ evaluated at $v$ for $p(v|a)$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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