How to take expectation of a hierarchical model?

326 Views Asked by At

If I have a hierarchical model, where $$ X \sim Bin(n, p) $$ $$ p \sim Beta(\alpha, \beta) $$ Can I say that $\mathbf{E}[x] = n\mathbf{E}(p) = n\dfrac{\alpha}{\alpha+\beta}$?

It seems not, then how should I get the expectation in terms of $\alpha$ and $\beta$?