# Posterior predictive distribution in a Bernoulli process.

Suppose there are $k$ successes in a Bernoulli population $X = \{x_1, \ldots, x_n\}$. I would like to calculate the posterior predictive distribution $f(x | X)$ where $x = \{0,1\}$. I assume the Jeffreys prior.

The probability of a success ($x=1$) is given by the integral

$$\int_0^1 \frac{p^{k+1}(1-p)^{n-k}}{\sqrt{p(1-p)}} \, dp.$$

Using the techniques from this problem, I've produced the antiderivative

$$\frac{p^{k+\frac{3}{2}}}{k+\frac{3}{2}} \cdot \ _2F_1(k+\frac{3}{2}, k-n + \frac{1}{2}, k+\frac{5}{2}, p)$$ where $_2F_1$ is the hypergeometric function. This hypergeometric function is defined only when $c>a+b$ or $k + \frac{5}{2} > 2k - n - 2 \iff n-k > \frac{-1}{2}$; i.e. always.

In this case, the solution is given by an identity of Gauss. So, my final answer is $$\frac{\Gamma(k +\frac{5}{2})\Gamma(n - k +\frac{1}{2})}{(k+\frac{3}{2})\Gamma(\frac{1}{2})\Gamma(n +\frac{3}{2})}.$$ The predictive distribution for a failure is similar. Also, there should be some normalizing constant floating around somewhere.

I have a bad feeling I've made one or many mistakes along the way. I would be very grateful if someone could let me know if I've made any errors, conceptual or otherwise.

Thanks.

Edit: I just calculated the normalizing constant, $c = \frac{(k+\frac{1}{2})\Gamma(1+n)}{\Gamma(k +\frac{3}{2})\Gamma(n-k + \frac{1}{2})}$. So, my new tentative answer is $$\frac{(k+\frac{1}{2})\Gamma(k+\frac{5}{2})\Gamma(1+n)}{(k+\frac{3}{2})\Gamma(\frac{1}{2})\Gamma(k+\frac{3}{2})\Gamma(n+\frac{3}{2})}.$$