Multiple-Group Normal Mean Posterior Analyzer

The Normal Distribution Across Multiple Groups

\[ f(x \mid \mu, \sigma^2) = \frac{1}{\sqrt{2\pi\sigma^2}} e^{ -\frac{(x - \mu)^2}{2\sigma^2} }, \quad \mu \sim \mathcal{N}(\mu_0, \sigma_0^2). \]

When you have multiple groups of normally distributed data with a known variance, each group may have a different underlying mean \(\mu_i\). By treating each group’s unknown \(\mu_i\) as a random variable with a Normal posterior, you can visualize the PDFs together and compare their likelihoods of being the highest or lowest among the groups.

When the variance is unknown, it is estimated separately for each group. With a non-informative prior, each group’s posterior for \(\mu_i\) is a Student-t distribution with \(n_i - 1\) degrees of freedom, centred on the group’s sample mean \(\bar{x}_i\) with scale \(s_i/\sqrt{n_i}\).