# Beta-Binomial mixture vs Beta-Binomial multilevel model?

I first read about the Beta PDF in the context that it was conjugate to the Binomial distribution; a Beta prior with a Binomial likelihood returns a Beta posterior. So this sounds to me like a multilevel model. However, I've come across the Beta-Binomial PMF.

Differences I've noticed: Beta-Binomial conj prior is continuous and a closed form MAP solution exists. The Beta-Binomial mixture is discrete and an MLE solution exists.

Beyond these simple observations, I'm not sure when each would/wouldn't be appropriate and how they differ. Thoughts? Is there a deeper relationship here or is it just inconvenient that they have such similar names?

Follow up, I see that among PyMC3's discrete likelihood functions Beta-Binomial is built in. Given what you've said. When would I use the Binomial likelihood vs the Beta-Binomial likelihood, both assuming a Beta prior? And how do these differences affect terms of the posterior-predictive distribution?

They are both pieces of the beta-binomial model. In beta-binomial model, the predicted variable $$y$$ follows the binomial distribution, where the number of samples $$n$$ is known and we want to learn the "probability of success" $$p$$. For this, we are using a Bayesian model, where beta distribution with hyperparameters $$\alpha$$ and $$\beta$$ serves as a prior for $$p$$:
\begin{align} p &\sim \mathsf{Beta}(\alpha, \beta) \\ y &\sim \mathsf{Binomial}(n, p) \end{align}
In such a case, due to conjugacy, the posterior distribution for $$p$$ is also beta distributed. On another hand, the posterior predictive distribution, i.e. the distribution for your predictions of $$\hat y$$, is beta-binomial distribution.