Bayesian modeling example: parameter estimation from repeated measurements
We will consider one of the simplest examples of parameter estimation, and one that comes up often in research applications. Let’s say we repeat a measurement many times. This could be beak depths of finches, fluorescence intensity in a cell, etc. The possibilities abound. To have a concrete example in mind for this example, let’s assume we are measuring the length of C. elegans eggs.
Our measurements of C. elegans egg length are
We wish to calculate
To compute the posterior, we use Bayes’s theorem.
Since the evidence,
to ensure normalization of the posterior
The likelihood
To specify the likelihood, we have to ask what we expect from the data,
given a value of
the product of Dirac delta functions. Of course, this is really never the case. There will be natural variation in egg length and some errors in measurement and/or the system has variables that confound the measurement. What, then should we choose for our likelihood?
That choice is of course dependent the story/theoretical modeling behind data generation. For our purposes here, we shall assume our data are generated from a Normal likelihood. Since this distribution gets heavy use, I will pause here to talk a bit more about it.
The Normal distribution
A univariate Normal (also known as Gaussian), probability distribution has a probability density function (PDF) of
The parameter
The central limit theorem says that any quantity that emerges from a large number of subprocesses tends to be Normally distributed, provided none of the subprocesses is very broadly distributed. We will not prove this important theorem, but we make use of it when choosing likelihood distributions based on the stories behind the generative process. Indeed, in the simple case of estimating a single parameter where many processes may contribute to noise in the measurement, the Normal distribution is a good choice for a likelihood.
More generally, the multivariate Normal distribution for
where
where
The likelihood revisited: and another parameter
For the purposes of this demonstration of parameter estimation, we assume the Normal distribution is a good choice for our likelihood for repeated measurements (as it often is). We have to decide how the measurements are related to specify how many entries in the covariance matrix we need to specify as parameters. It is often the case that the measurements are i.i.d, so that only a single mean and variance are specified. So, we choose our likelihood to be
By choosing this as our likelihood, we are saying that we expect our
measurements to have a well-defined mean
But wait a minute; we had a single parameter,
After we compute the posterior, we can still find the posterior probability distribution we are after by marginalizing.
Choice of prior
Now that we have defined a likelihood, we know what the parameters are
and we can define a prior,
How might we choose prior distributions for
with
For
with
In this
case, we have the obvious issue that there is nonzero probability that
Succinctly stating the model
Our model is complete, which means that we have now completely specified the posterior. We can write it out. First, defining the parametrization of the priors.
Then, the posterior is
with
Oh my, this is a mess, even for this simple model! Even though we have the posterior, it is very hard to make sense of it. Essentially the rest of the course involved making sense of the posterior, which is the challenge. It turns out that writing it down is relatively easy.
One of the first things we can do to make sense of our model, and also to specify it, is to use a shorthand for model specification. First of all, we do not need to specify the evidence, since it is always given by integrating the likelihood and prior; that is by fully marginalizing the likelihood. So, we will always omit its specification. Now, we would like to have a notation for stating the likelihood and prior. English works well.
The parameter
is Normally distributed with location parameter 50 µm and scale parameter 20 µm. The parameter
is Normally distributed with location parameter 5 µm and scale parameter 2 µm. The egg lengths are i.i.d. and are Normally distributed with location parameter
and scale parameter .
This is much easier to understand. We can write this with a convenient, and self evident, shorthand. [1]
Here, the symbol