# Solved – Bayesian update for a univariate normal distribution with unknown mean and variance

Suppose I have some random process \$X\$ which is emitting values which follow a normal distribution:

\$\$X sim N(μ, σ^2)\$\$

Both \$μ\$ and \$σ\$ are unknown, so I want to model each of them with their own distribution which I will update every time I observe a new value.

How can I do this?

For \$μ\$ it seems obvious that I should model it with its own normal distribution: \$μ sim N(μ_μ, σ_μ^2)\$. For \$σ^2\$ it's not clear what distribution I should use – my googling so far suggests that inverse-gamma would make the math work-out nicely but it's not clear to me that it even makes sense to use two independent distributions for \$μ\$ and \$σ^2\$.

So my question is: what mathematical model should someone use in this situation (or, if there's a choice, what are the options), and how exactly does one calculate the posterior parameters of the model given the prior parameters and an observation \$x\$?

Contents