# How to apply Bayes' theorem to the search for a fisherman lost at sea

The article The Odds, Continually Updated mentions the story of a Long Island fisherman who literally owes his life to Bayesian Statistics. Here's the short version:

There are two fishermen on a boat in the middle of the night. While one is asleep, the other falls into the ocean. The boat continues to troll along on autopilot all through the night until the first guy finally wakes up and notifies the Coast Guard. The Coast Guard uses a piece of software called SAROPS (Search and Rescue Optimal Planning System) to find him just in time, as he was hypothermic and just about out of energy to stay afloat.

Here's the long version: A Speck In The Sea

I wanted to know more about how Bayes' Theorem is actually applied here. I found out quite a bit about the SAROPS software just by googling.

The SAROPS simulator

The simulator component takes into account timely data such as ocean current, wind, etc. and simulates thousands of possible drift paths. From those drift paths, a probability distribution map is created.

Note that the following graphics do not refer to the case of the missing fisherman I mentioned above, but are a toy example taken from this presentation

Probability Map 1 (Red indicates the highest probability; blue the lowest)

Note the circle that is the starting location.

Probability Map 2 - More time has passed

Note that the probability map has become multimodal. That is because in this example, multiple scenarios are accounted for:

1. The person is floating in the water - top-middle mode
2. The person is in a life raft (more affected by the wind out of the North) - bottom 2 modes (split because of "jibing effects")

Probability Map 3 - Search has been conducted along the rectangular paths in red This image shows the optimal paths produced by the planner (another component of SAROPS). As you can see, those paths were searched and the probability map has been updated by the simulator.

You might be wondering why the areas that have been searched have not been reduced to a zero probability. That's because there's a probability of failure, $p(\text{fail})$, factored in, that is there's a non-negligible chance that the searcher will overlook the person in the water. Understandably, the probability of failure is much higher for a lone person afloat than for a person in a life raft (easier to see), which is why the probabilities in the top area did not go down very much.

Effects of an unsuccessful search

This is where Bayes' Theorem comes in to play. Once a search is conducted, the probability map gets updated accordingly so another search can be planned optimally.

After reviewing Bayes' Theorem on wikipedia and in the article An Intuitive (and Short) Explanation of Bayes’ Theorem on BetterExplained.com

I took the Bayes' equation:

$$P(\text{A}\mid\text{X}) = \frac{P(\text{X}\mid\text{A}) \times P(\text{A})}{P(\text{X})}$$

And defined A and X as follows...

• Event A: The person is in this area (grid cell)

• Test X: Unsuccessful search over that area (grid cell) i.e. Searched that area and didn't see anything

Yielding,

$$P(\text{person there}\mid\text{unsuccessful}) = \frac{P(\text{unsuccessful}\mid\text{person there}) \times P(\text{person there})}{P(\text{unsuccessful})}$$

I found in Search and Rescue Optimal Planning System that SAROPS calculates the probability of a failed search, $P(\text{fail})$, by taking into account the search paths and simulated drift paths. So for simplicity let's assume that we know what the value of $P(\text{fail})$ is.

So now we have,

$$P(\text{person there}\mid\text{unsuccessful}) = \frac{P(\text{fail}) \times P(\text{person there})}{P(\text{unsuccessful})}$$

1. Is the Bayes' equation applied correctly here?

2. How would the denominator, the probability of an unsuccessful search, be calculated?

Also in Search and Rescue Optimal Planning System, they say

The prior probabilities are "normalized in the usual Bayesian fashion" to produce the posterior probabilities

3. What does "normalized in the normal Bayesian fashion" mean?

Does it mean all probabilities are divided by $P(\text{unsuccessful})$, or just simply normalized to ensure the entire probability map adds up to one? Or, are these one and the same?

4. Lastly, what would be the correct way to normalize the gridded probability map after you've updated for an unsuccessful search, considering that since you haven't searched ALL of the areas (grid cells) you'd have some cells equal to $P(\text{person there})$ and some equal to $P(\text{person there}\mid\text{unsuccessful})$?

Yet another simplification note - according to Search and Rescue Optimal Planning System the posterior distribution is actually calculated by updating the probabilities of the simulated drift paths, and THEN re-generating the gridded probability map. In order to keep this example simple enough, I chose to ignore the sim paths and focus on the grid cells.

1. Assuming independence between the grid cells, then yes it appears Bayes' Theorem has been properly applied.
2. The denominator can be expanded, e.g. $$P(X) = P(X|A)P(A) + P(X|A^c)P(A^c)$$ using the law total of probability where $A^c$ is the complement of $A$, i.e. the person is not there. Likely you would assume $P(X|A^c)=1$.
3. I'm not really sure what "normalized in the normal Bayesian fashion means" since I didn't write the manual. But they are certainly talking about the fact that the following three equations are sufficient to find $P(A|X)$: $$P(A|X) \propto P(X|A)P(A)\quad P(A^c|X), \propto P(X|A^c)P(A^c), \mbox{ and } P(A|X)+P(A^c|X) = 1$$ So you never have to calculate $P(X)$, i.e. the normalizing constant. Whether they used this to update the probability for a single grid cell or for the entire map, I don't know (probably both).
4. Let's expand the notation to have grid cell $i$ and $A_i$ be the event the individual is in grid cell $i$ and $X_i$ be the event that grid cell $i$ was searched and nobody was found. With the new notation, $X$ is going to be the collection of searches that failed. We assume the following:

• $\sum_i P(A_i|X)=1$, i.e. after performing searches, the sum overall cells of the probability that the individual is in that cell is 1. This is the total law of probability again.
• If we assume searching in one cell does not tell us anything about any other cell, then for cells that were searched $P(A_i|X) = P(A_i|X_i)\propto P(X_i|A_i)P(A_i)$ and for cells that were not searched $P(A_i|X) \propto P(A_i)$. If we don't assume independence, the formulas will be more complicated but the intuition will be similar, i.e. calculating $P(A_i|X)$ up to a proportionality constant.

We can use these two assumptions to calculate $P(A_i|X)$ and update the map accordingly.

• Thank you for the excellent answers ;) So, assuming grid cell independence and $\sum_{i}P(A_i|X)=1$, after searching every cell once would it be valid to calculate $P(X|A)P(A)$ for each cell and then divide each cell by the sum of all cells ($\sum_{i}P(X|A)P(A_i)$) to normalize?
– mlai
Oct 19, 2014 at 11:53
• I just realized that searching every cell with a fixed probability of failure would result in absolutely no change among the probability distribution :)
– mlai
Oct 19, 2014 at 12:24
• So to rephrase... Assuming the law of total probability (as in your answer to 4.), after some (but not all) of the cells were searched could we normalize by dividing each cell by the sum of all of the cells? ...using $P(X|A)P(A_i)$ for the value of cells that have been searched and $P(A_i)$ for those that haven't.
– mlai
Oct 19, 2014 at 12:38

I was pointed to a book that has a whole chapter dedicated to my question - Naval Operations Analysis - by a former professor who used to be a helicopter pilot and has actually performed search and rescue missions, no less!

In chapter 8 an example is provided something like this (I customized it a bit):

To start with, there's a gridded prior distribution for the location of the missing person(s), boat, etc.

Prior distribution:

A search is performed on part of the grid and the probabilities are updated with a normalized posterior distribution by applying the Bayes' equation in the same way I mentioned in my questions:

$$P(\text{target in (i,j)}\mid\text{no detection}) = \frac{P(\text{no detection}\mid\text{target in (i,j)}) \times P(\text{target in (i,j)})}{P(\text{no detection})}$$

where (i,j) = (lat,long)

In this case, I decided to search column 3 because that column had the largest total prior probability.

Normalized posterior distribution after searching the third column w/ pFail = 0.2:

My question was mainly about how the posterior was normalized. Here's how it was done in the book - simply divide each individual posterior probability by the total sum, S:

I chose a 0.2 probability of a failed search because my professor had this to say, "We only search to 80% probability of detection because that is typically the best tradeoff between timlieness and accuracy."

Just for kicks, I ran another example with a pFail of 0.5. Whereas in the first example (pFail = 0.2), the next best search route (given the normalized posterior and assuming straight-line searches, no diagonal or zig-zag) would be to fly over column 2, in the second example (pFail = 0.5) the next best route is over row 2.

Normalized posterior distribution after searching the third column w/ pFail = 0.5:

He also added this, "Aircraft carry a small checklist with them to help determine best altitude and airspeed. Working this in a flying helicopter is like sitting atop a washing machine, reading a book that is duct taped to a different washing machine."