Bayesian Inference for the Mean of a Gaussian Distribution with Known Mean

Hiroaki Kubo
2 min readNov 13, 2023

--

Bayesian inference about the mean of a Gaussian distribution when the variance is known was shared in this article.

Now, let us estimate the variance, with the mean known. Again, choosing a distribution that is conjugate to the prior distribution greatly simplifies the computation. Since it is much more convenient to operate with presision λ≡1/σ2, so we will use precision. The likelihood function for λ is as follows.

From this formula, the conjugate prior of precision must be proportional to the product of the power of λ and the exponent of the linear function of λ. This condition applies to the gamma distribution defined as follows.

Since the posterior distribution is the prior distribution multiplied by the likelihood function, we have

It can be seen that this is the gamma distribution Gam(λaN​,bN​) when the parameters are set as follows

σML2​ is the maximum likelihood estimator of variance.

You can draw the Gaussian distribution with known mean by running this code.

Parameters a and b are being updated, and it can be seen that the accuracy is gradually approaching 1.

--

--

Hiroaki Kubo

Computer vision engineer. 3D computer vision/ Machine learning / Optimization / Graphics, https://www.linkedin.com/in/hiroaki-kubo-2819951ba/