# Is it possible to find the distribution parameters of a normal hierarchical model given specific values for the hyperparameters?

I would like to find out if it is possible to calculate the distribution parameters, i.e., determine $\mu$, $\sigma$, for a random variable $y$, given that:

\begin{align} y &\backsim Normal(\mu, \sigma) \\ \mu &\backsim Normal(a, b) \\ \sigma &\backsim Normal(n, m) \end{align}

where $a,b,n,m$ are known distribution parameters.

I have been able to model the system using a very simple Monte Carlo simulation method which I used to estimate the the parameters, however I would like to check my results using an analytical method.

• Your prior for the std deviation of $y$ has a normal distribution? – Scortchi - Reinstate Monica Jan 21 '16 at 14:11
• In principle the method would be to integrate out the parameters $a$, $b$, $n$ and $m$. However, I believe in this case there will be no simple analytic solution. Simulating by drawing $(\mu, \sigma)$ and then simulating $Y|\mu, \sigma \sim N(\mu, \sigma)$ seems easiest. – Björn Jan 21 '16 at 14:43
• @Björn's surely right. But where did your priors come from? As standard deviation can't be negative, the normal - even a truncated normal - seems an unusual choice. If you're not wedded to them then letting $\frac{1}{\sigma^2}$ have a gamma distribution & $\mu$ a normal distribution with variance proportional to $\sigma^2$ allows the posterior distribution for both to be derived analytically. – Scortchi - Reinstate Monica Jan 21 '16 at 17:35