In the first post, we discussed the importance of model updating, now we want to focus on the mathematics that comes into play. To do so, we will make use of Bayes’ theorem. In particular, we will need an alternative formulation of the (hopefully) well-known result.

First of all, we will briefly revise conditional probabilities.

Definition.Given two events and in a probability space, with , theconditional probability of givenis the quantity

The idea is the following: we know that some event ( in the definition above) has happened, and we want to renormalise our notion of probability to the new reality we are living in, the one where is certain, as it already happened. One can notice that the conditional probability with respect to is itself a probability measure, and, in particular, satisfies all the properties of a probability. At the same time, it is worth noticing, with an example, that , in general, is not equal to . Among inmates in Italy, roughly 90% are male, so we can write. However, it is definitely false that the probability that an Italian male is an inmate, that is , is 90%. At the same time, the two probabilities are connected with one another, as the following result shows.

Theorem (Bayes, probability form).Given two events with nonzero probability and , the following identity holds:

The proof of this result is an immediate computation, but we are actually not so interested in the proof itself. Truth be told, we are not particularly interested in the link between and , in this context of mathematical modelling. We will then restate the same result in a slightly different way.

Consider a belief you have about the world, in particular something that you can test. For example, if you just popped up in room A206 during a class of “Mathematical Models”, you might think that this is a course for students in the Master in Mathematics for Models. However, you cannot be sure of this, so you assign some probability to your belief, as a measure of your confidence. Let’s denote by the hypothesis we believe in (in the example, the course being in the program for Models), and with the amount of our belief, for example, . We can now run an experiment, , to test our assumption and improve our knowledge and understanding. For example, we can ask another attending student the program they are part of, say that is “the attending student is in the Master for Modelling”. As soon as we gather this information, assuming it is positive, we can update our belief in the following way:

Our probabilities change, and we do not expect that a positive answer closes the question once for all, since it could also happen that a student in a program is taking also courses from a different program (and it could also happen that the student is not in the program we think, without it ruling out our hypothesis). We want to measure how a positive (or negative) answer changes our belief. However, to do so, we need to assess the probabilities coming into play. On one hand, we need to know the probability that a generic student is in the Master in Mathematics for Models, , on the other, we also need the probability that, assuming that this course is for the Master in Models, a generic student taking the course is in fact enrolled in that program, .

So we have updated our belief from the one we held at the beginning , also called *prior belief* or just *prior*, to a new one, , that takes into account the information we obtained and is called the *posterior (belief)*. This is the way we are going to use Bayes’ theorem in the context of modelling.

There are two remarks here. The first one regards the denominator: . It could be hard to assess this probability, so sometimes one uses the law of total probability (or factorisation formula) to write it in a different way, using any suitable partition of the sample space. A typical solution is to use this identity:

(1)

where with we are denoting the complement of the event . Notice that this choice allows us to recycle the probabilities and , and requires us to assess only , which however might be easier to estimate than since we are in a specific setting, .

As for the second remark, it has to do with something we have mentioned above: there is this sentence “you cannot be sure of this”. If we want to use Bayes’ theorem, we can never ever assign probability 0 or 1 to an event, or in other terms be absolutely sure of something. If we were to do that, no amount of information or experiments could make us change our minds. To see it, try to plug or into (1) and see what happens. This is crucial, it tells us that if we feel we are completely certain about something (say, homeopathy does not work) but we want to be good scientists, we cannot assign a probability 0 to homeopathy, we have to give a very small (but nonzero) probability, for example, .

We have mentioned, however, that we want to check multiple times our assumption. For example, after asking the first student about the master program they are enrolled in, we might want to ask a second one. In other words, we need to use Bayes’ theorem with repeated experiments. We will see how to do that, and the issues it raises with the probabilistic formulation of the theorem, in another post.

## One thought on “Bayes’ Theorem – Part 1”