# Marginal Distribution of Hierarchal Model Normal distribution with unknown mean and precision

I am trying to use a Hierarchical model where there I have a normal distribution with random mean and precision:

$$y \sim N(\mu, \tau)\\ \mu \sim N(M, T)\\ \tau \sim Gamma(\alpha, \beta)$$

I'm trying to marginalize out $$\mu$$ and $$\tau$$ to find $$p(y | M, T, \alpha, \beta)$$. I think I can marginalize out $$\mu$$: $$\int d\mu d\tau N(y | \mu,\tau) N(\mu | M,T) Gamma(\tau | \alpha, \beta)\\ =\int d\tau N\left(y | M, \frac{1}{1/\tau + 1/T}\right)Gamma(\tau |\alpha, \beta)\\$$ I'm not sure how to complete the integral over $$\tau$$. I know that if T=0 the distribution would be a student-t but other than that I'm stuck.

• The model is not hierarchical. The integral cannot be solved in closed form. – Xi'an Apr 6 at 12:09
• okay good to know thanks. Just out of curiosity why do you say it's not hierarchical? My definition seems pretty similar to what is found in en.wikipedia.org/wiki/Bayesian_hierarchical_modeling. I just haven't included the subscripts and in this case and I haven't included a prior. Maybe you would prefer the term compound probability distribution. – ablanch5 Apr 7 at 14:29
• A hierarchical model has a second prior specified over the parameters of a first prior. – Xi'an Apr 8 at 5:45