I'm struggle with figuring out how to prove:


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:



$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}$


$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)}$


$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?


1 Answer 1


There's a simpler way to tackle it, using the Law of Iterated Expectations. For notational clarity, I will define $y$ as "future $x$", so your first line would be $\mathbb{E}(y|x) = \dots$. Writing out the Law as applied to this case gives us:

$$\mathbb{E}[y|x] = \mathbb{E}_{\theta | x} \mathbb{E}[y|\theta]$$

We have $\mathbb{E}[y|\theta] = n\theta$. Taking the expectation of this with respect to $\theta | x$ gives us:

$$\mathbb{E}[y|x] = n\mathbb{E}[\theta | x] = n {a_1 \over a_1 + b_1}$$

The derivation of $a_1$ and $b_1$ as parameters of the posterior $p(\theta | x)$ I believe you have done above, although the Latex formatting seems not to be 100% correct in the relevant section at the time of this writing.

  • $\begingroup$ $E(y|x)=E(E(y|\theta)|x)=E(n.\theta|x)=nE(\theta|x)$, Great my friend, Ive seen this theorem before but not for $y|x$. Thank you so much. $\endgroup$ Nov 28, 2021 at 9:23
  • $\begingroup$ Could you tell me if both supports are the same? $\endgroup$ Nov 28, 2021 at 22:51
  • $\begingroup$ Yes, they are. The Law doesn't change that relative to working it out by hand the long way $\endgroup$
    – jbowman
    Nov 29, 2021 at 2:01

Your Answer

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

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