I'd like to use Bayes' Theorem on data obtained through a small random sample, and I want to use Agresti-Coull (or any other alternative technique) to know how big the uncertainty is.
Here is Bayes' Theorem:
$P(A|B) = \frac{P(B|A)\cdot P(A)}{P(B)}$
Now, all the data I have on this system is obtained from small random samples, so there's a large uncertainty involved with all three variables, $P(B|A)$, $P(A)$ and $P(B)$.
I've been using Agresti-Coull to obtain both the value and the uncertainty for each of these three variables. (I represent the number+-uncertainty
as a ufloat
object using the uncertainties
package.)
But using Agresti-Coull three times separately for these three variables is a problem; They are dependent on each other. So I've been getting impossible results. For example, if you let $P(B)$'s uncertainty pull it downward, and the respective uncertainties of $P(B|A)$ and $P(A)$ pull them upwards, you get a total probability bigger than one.
Is there a way to do Agresti-Coull-style approximation on the whole Bayes expression instead of doing it on the three pieces separately?
ufloat()
creates aUFloat
object. Case does matter, here (the two names were chosen to be close to each other on purpose). :) $\endgroup$