|
| 1 | +--- |
| 2 | +layout: proof |
| 3 | +mathjax: true |
| 4 | + |
| 5 | +author: "Joram Soch" |
| 6 | +affiliation: "BCCN Berlin" |
| 7 | +e_mail: "joram.soch@bccn-berlin.de" |
| 8 | +date: 2022-11-26 11:42:00 |
| 9 | + |
| 10 | +title: "Posterior probability of the alternative model for binomial observations" |
| 11 | +chapter: "Statistical Models" |
| 12 | +section: "Count data" |
| 13 | +topic: "Binomial observations" |
| 14 | +theorem: "Posterior probability" |
| 15 | + |
| 16 | +sources: |
| 17 | + |
| 18 | +proof_id: "P384" |
| 19 | +shortcut: "bin-pp" |
| 20 | +username: "JoramSoch" |
| 21 | +--- |
| 22 | + |
| 23 | + |
| 24 | +**Theorem:** Let $y$ be the number of successes resulting from $n$ independent trials with unknown success probability $p$, such that $y$ follows a [binomial distribution](/D/bin): |
| 25 | + |
| 26 | +$$ \label{eq:Bin} |
| 27 | +y \sim \mathrm{Bin}(n,p) \; . |
| 28 | +$$ |
| 29 | + |
| 30 | +Moreover, assume two [statistical models](/D/fpm), one assuming that $p$ is 0.5 ([null model](/D/h0)), the other imposing a [beta distribution](/P/bin-prior) as the [prior distribution](/D/prior) on the model parameter $p$ ([alternative](/D/h1)): |
| 31 | + |
| 32 | +$$ \label{eq:Bin-m01} |
| 33 | +\begin{split} |
| 34 | +m_0&: \; y \sim \mathrm{Bin}(n,p), \; p = 0.5 \\ |
| 35 | +m_1&: \; y \sim \mathrm{Bin}(n,p), \; p \sim \mathrm{Bet}(\alpha_0, \beta_0) \; . |
| 36 | +\end{split} |
| 37 | +$$ |
| 38 | + |
| 39 | +Then, the [posterior probability](/D/pmp) of the [alternative model](/D/h1) is given by |
| 40 | + |
| 41 | +$$ \label{eq:Bin-PP1} |
| 42 | +p(m_1|y) = \frac{1}{1 + 2^{-n} \left[ B(\alpha_0,\beta_0) / B(\alpha_n,\beta_n) \right]} |
| 43 | +$$ |
| 44 | + |
| 45 | +where $B(x,y)$ is the beta function and $\alpha_n$ and $\beta_n$ are the [posterior hyperparameters for binomial observations](/P/bin-post) which are functions of the [number of trials](/D/bin) $n$ and the [number of successes](/D/bin) $y$. |
| 46 | + |
| 47 | + |
| 48 | +**Proof:** [The posterior probability for one of two models is a function of the log Bayes factor in favor of this model](/P/pmp-lbf): |
| 49 | + |
| 50 | +$$ \label{eq:PP-LBF} |
| 51 | +p(m_1|y) = \frac{\exp(\mathrm{LBF}_{12})}{\exp(\mathrm{LBF}_{12}) + 1} \; . |
| 52 | +$$ |
| 53 | + |
| 54 | +The [log Bayes factor in favor of the alternative model for binomial observations](/P/bin-lbf) is given by |
| 55 | + |
| 56 | +$$ \label{eq:Bin-LBF10} |
| 57 | +\mathrm{LBF}_{10} = \log B(\alpha_n,\beta_n) - \log B(\alpha_0,\beta_0) - n \log \left( \frac{1}{2} \right) \; . |
| 58 | +$$ |
| 59 | + |
| 60 | +and the corresponding [Bayes factor](/D/bf), i.e. [exponentiated log Bayes factor](/P/lbf-der), is equal to |
| 61 | + |
| 62 | +$$ \label{eq:Bin-BF10} |
| 63 | +\mathrm{BF}_{10} = \exp(\mathrm{LBF}_{10}) = 2^n \cdot \frac{B(\alpha_n,\beta_n)}{B(\alpha_0,\beta_0)} \; . |
| 64 | +$$ |
| 65 | + |
| 66 | +Thus, the posterior probability of the alternative, assuming a prior distribution over the probability $p$, compared to the null model, assuming a fixed probability $p = 0.5$, follows as |
| 67 | + |
| 68 | +$$ \label{eq:Bin-PP1-qed} |
| 69 | +\begin{split} |
| 70 | +p(m_1|y) &\overset{\eqref{eq:PP-LBF}}{=} \frac{\exp(\mathrm{LBF}_{10})}{\exp(\mathrm{LBF}_{10}) + 1} \\ |
| 71 | +&\overset{\eqref{eq:Bin-BF10}}{=} \frac{2^n \cdot \frac{B(\alpha_n,\beta_n)}{B(\alpha_0,\beta_0)}}{2^n \cdot \frac{B(\alpha_n,\beta_n)}{B(\alpha_0,\beta_0)} + 1} \\ |
| 72 | +&= \frac{2^n \cdot \frac{B(\alpha_n,\beta_n)}{B(\alpha_0,\beta_0)}}{2^n \cdot \frac{B(\alpha_n,\beta_n)}{B(\alpha_0,\beta_0)} \left( 1 + 2^{-n} \frac{B(\alpha_0,\beta_0)}{B(\alpha_n,\beta_n)} \right)} \\ |
| 73 | +&= \frac{1}{1 + 2^{-n} \left[ B(\alpha_0,\beta_0) / B(\alpha_n,\beta_n) \right]} |
| 74 | +\end{split} |
| 75 | +$$ |
| 76 | + |
| 77 | +where the [posterior hyperparameters](/D/post) [are given by](/P/bin-post) |
| 78 | + |
| 79 | +$$ \label{eq:Bin-post-par} |
| 80 | +\begin{split} |
| 81 | +\alpha_n &= \alpha_0 + y \\ |
| 82 | +\beta_n &= \beta_0 + (n-y) |
| 83 | +\end{split} |
| 84 | +$$ |
| 85 | + |
| 86 | +with the [number of trials](/D/bin) $n$ and the [number of successes](/D/bin) $y$. |
0 commit comments