I'm struggle with figuring out how to prove:
$E(\tilde{x}|x)=n\frac{a1}{a1+b1}$
where $x|\theta \sim Bin(n,\theta)$, $\theta \sim Beta(\alpha,\beta)$ and so $\theta|x\sim Beta(a_1=\sum{x_i}+\alpha,a_2=n.N-\sum_{}x_i+\beta)$ ($N$ as sample size)
I tried:
$p(\tilde{x}|x)=\displaystyle\int_{\theta}p(\tilde{x}|\theta)f(\theta|x)d\theta$
$p(\tilde{x}|\theta)=\displaystyle\frac{n!}{\tilde{x}!(n-\tilde{x})!}\theta^{\tilde{x}}(1-\theta)^{n-\tilde{x}}$
$f(\theta|x)=\displaystyle\frac{1}{B(\sum x_i+\alpha, n.N-\sum x_i + \beta)}\theta^{\sum x_i+\alpha-1 }(1-\theta)^{n.N-\sum x_i +\beta -1}$
so
$p(\tilde{x}|x)\propto \displaystyle\frac{n!}{\tilde{x}!(n-\tilde{x})!}\displaystyle\int_{\theta} \theta^{\tilde{x}+\sum x_i +\alpha -1}(1-\theta)^{n-\tilde{x}+n.N-\sum x_i +\beta -1}d\theta $
$p(\tilde{x}|x)\propto \displaystyle\frac{n!}{\tilde{x}!(n-\tilde{x})!}B(\tilde{x}+\sum x_i +\alpha, n-\tilde{x}+n.N-\sum x_i +\beta)$
I don't know what that distribution is so I've explicited the formula:
$p(\tilde{x}|x)=\displaystyle\frac{n!}{\tilde{x}!(n-\tilde{x})!}\frac{B(\tilde{x}+\sum x_i +\alpha, n-\tilde{x}+n.N-\sum x_i +\beta)}{B(\sum x_i +\alpha, n.N-\sum x_i +\beta)}$
so:
$E(\tilde{x}|x)=\displaystyle\sum_{\tilde{x}=1}^{n}\tilde{x}\displaystyle\frac{n!}{\tilde{x}!(n-\tilde{x})!}\frac{B(\tilde{x}+\sum x_i +\alpha, n-\tilde{x}+n.N-\sum x_i +\beta)}{B(\sum x_i +\alpha, n.N-\sum x_i +\beta)}$
Making some math I got:
$E(\tilde{x}|x)=\displaystyle\sum_{\tilde{x}=1}^{n}\frac{1}{B(\tilde{x},n-\tilde{x}+1)}\frac{B(\tilde{x}+\sum x_i +\alpha, n-\tilde{x}+n.N-\sum x_i +\beta)}{B(\sum x_i +\alpha, n.N-\sum x_i +\beta)}$
So here is the question:
1- Is the $\tilde{x}$ support the same as $x|\theta$ support?
2- if so then how to solve this summation?