The Elusive Lighthouse: Part 2
Let There be a Lighthouse
In the preceding post we attempted to locate a queer lighthouse from the incident locations of its uniformly angular distributed flashes upon a straight beach. The geometry of the scenario is shown below.
It turned out to be a difficult problem, because the flashpoints assume a Cauchy distribution, which makes the intuitively appealing sample mean totally useless. In this post, we track down the lighthouse by applying sound principles of probability theory which are commonly called “Bayesian”.
The Bayesian method is a very general approach to reasoning in the presence of uncertainty. Many common statistical methods can be derived from it by applying simple assumptions. For example, if the flashpoints were distributed normally, then the most probable value of , under the simplest Bayesian assumptions, would be the sample mean of the flashpoints. But Bayesian principles really come into their own when common statistical assumptions don’t apply, as for the Cauchy distribution.
In the last post we derived the estimator density , which enabled us to find an expression for the probability-of-bad-estimate . But notice that depends on and in general, and in this case on . This is unfortunate, because and are unknown. The most we can get from is a series of “if-then” statements like if , then is likely to be this close to . But what if ? Moreover, what we really want to know is not how stands subject to , but how stands subject to . Fortunately, the inference may be reversed in that way by applying Bayes’ rule, and it obliges us to consider what we know about prior to its application.
Bayes’ rule expresses the posterior density for and as:
where is called the likelihood, is the prior for and , and is a normalisation factor. Bayes’ rule is very easy to understand intuitively. The prior captures what we know about the location of the lighthouse before taking account of the flashes. The likelihood specifies where we ought to expect flashes for each possible lighthouse location. And the posterior expresses what is known about the location of the lighthouse after taking account of the flashes.
We know that is a Cauchy distribution, so we know what the likelihood is. The normalisation factor will be worked out later. The prior is where we address head-on the aforementioned inescapable question, “What if ?” We must think hard about what we know about the location of the lighthouse before considering any flashpoints. The only relevant information in the opening paragraph is that “you happen to know there’s a lighthouse somewhere out to sea”. That means (i) ; and (ii) no location satisfying that condition should be favoured over any other. These constraints imply a uniform distribution on the upper half-plane. Because that is an improper distribution defined only in the limit, we set finite bounds which we later relax to infinity. Our prior becomes
Now we can write down an expression for the posterior distribution:
Since the posterior is a probability distribution, it integrates to , so we have
Substituting into equation (3) we have
The terms cancel, and the integral remaining in the denominator is a constant with respect to and . Therefore
We can now take the limit and substitute the equation for to get our final expression for the posterior:
Let’s put our posterior to work to see what the flashes reveal about the location of the lighthouse. The following five images show posterior level curves for five different flashpoint samples of size ten. The level curves are equally-spaced across the height of the posterior, and the maximum is marked with a dot. In order to keep the plot range the same, not all of the flashpoints are shown.
Not only do we see “maximum a posteriori” (the central dot) estimates for and which seem plausible in light of the flashpoints; we get an appropriately nuanced distribution as well.
Finally, let’s take a look at how the posterior changes as more flashes are gathered. We take a sample of flashpoints and plot the contours that take account of the first , , , , and (all of them).
Notice that from to , the spread of the contours increases. This is because the overall spread of the flashpoints increases, countervailing the effect of their increasing number. It serves as a reminder that more data does not necessarily mean more certainty. Nevertheless, the convergence of the contours on the lighthouse with increasing shows that the method is sound.
How Far That Little Candle Throws His Beams!
We have learnt a number of lessons. Firstly, we have seen how orthodox statistical estimators can be assessed, and how they give rise to a series of “if-then” statements where the antecedent contains the quantities to be inferred, and the consequent contains the estimator (the data). Secondly, there are situations where such estimators are unsound—for example, when the sample mean is used to infer the location parameter of a Cauchy distribution. Thirdly, by switching the inferred quantities and the data back to their natural order, and explicitly addressing the inescapable question of prior knowledge, which orthodox methods neglect, the Bayesian method resolves these shortcomings.
In the real world, lighthouses don’t have an infinite throw, and sensors have limited precision. However, this is easily dealt with by modifying the flashpoint distribution. We might truncate it, widen it, or reduce the tails. In any case, if its form is logically derived from the effects in play, then it will yield an appropriate posterior distribution.
One is tempted to ask whether it is possible to derive more accurate predictions than those above. The surprising answer is “No”! It turns out that these posterior distributions capture exactly what the data imply: nothing more, nothing less. Wider distributions are too uncertain, and narrower distributions too confident. The Bayesian method is the means to do inference correctly, just as the propositional calculus is the means to do deduction correctly.
Bayes’ Theorem: casting its light across the world since .
Sivia, DS & Skilling, J 2006. Data Analysis: A Bayesian Tutorial. Oxford University Press, Oxford, United Kingdom.