# Bayesian estimate of the mean of a Normal distribution with unknown standard deviation

Assume that we have a set of n data samples from a Normal distribution with unknown mean m and unknown standard deviation s. We would like to estimate the mean together with the appropriate level of uncertainty. A Normal distribution can have a mean anywhere in [-∞, +∞], so we could use a Uniform improper prior p(m) = k. The uninformed prior for the standard deviation should be p(s) = 1/s to ensure invariance under a linear transformation. The likelihood function is given by the Normal distribution density function:

Multiplying the priors together with the likelihood function and integrating over all possible values of s, we arrive at the posterior distribution for m:

(1)

where x and  are the mean and sample standard deviation of the data values. The Student-t distribution with n degrees of freedom has probability density:

(2)

Equation 1 and 2 are the same functions if we set n = n - 1 and   .

Thus:

where t(n-1) represents the Student-t distribution with (n-1) degrees of freedom. This is the same result used in classical statistics.