Use of conditional probability

  • Chain rule of probability
  • Conditional probability
  • Bayesian inference formula
  • Update probabilistic previsions

Hello!

Resultado de imagem para bola de cristalSuppose an oil company intends to perform a significant investment within the next year. One of the parameters this company needs to evaluate is the oil future price, which can be strongly influenced by the global scenario. A team of analysts would try to forecast the magnitude and implications of some events, such as crisis in some supplier countries, the announcement of new reserves, or even some international trading disputes. 

Bayesian inference formula

Mathematically, we can describe the situation above as the following. The company needs to estimate a probability distribution of the future oil prices, $p(t, S)$, where $S$ if the oil price and $t$ denotes the future evaluation date. This probability distribution depends on a series of events $X=\{X_0, X_1, X_2, ...\}$, therefore $p(t, S) = p_t(S | \{X\})$. The notation $p(E | X)$ denotes a probability of an event $E$ given the conditional of an event $X$. In fact, the forecast of the team of analysts is more precise as higher the number of factors considered in $\{X\}$. At least, this one of the main arguments presented in the (very interesting) book named  Superforecasting by Dan Gardner.
When dealing with a chain of events, the joint probability obeys the so-called chain rule of probability:
$P(A,B,C)=P(A|B,C) \times P(B|C) \times P(C)$
Expression above says that the probability of a set of events can be decomposed in simpler probability statements that are conditioned to secondary events. The well-known Bayesian inference formula can be obtained from this chain rule. Consider a two-event case:
$P(A,B)=P(B,A)$
$P(A|B) \times P(B) = P(B|A) \times P(A)$
and finally:
$\frac{P(A|B)}{P(A)}  = \frac{P(B|A)}{P(B)}$
Formula above relates the individual probabilities with the conditional of the two events. It is important to mention that $P(A|B) \neq P(B|A)$, that is, the order of the events makes the whole difference. Let´s see an example to illustrate the use of the Bayesian inference formula.

Simple problem: probability of talking to someone in the elevator

The problem is the following. Suppose you live in an apartment at which in order to leave you need to take an elevator. What is the probability of take the elevator AND have a small talk with a person that you have met before?
The solution of this problem involves the calculation of $P(talk| occupied)$, that is, in order to talk to someone the elevator needs to be occupied by at least one person that is supposed to be a known person. The probability of an occupied elevator (during the time you use it) is given by $P(occupied)$. I´ll denominate the probability of talk to someone as $P(talk)$. In this example the importance of the order of the notation becomes quite clear. Consider the probability $P(occupied|talk)$, that is, the probability of having an occupied elevator given that we talk to someone. It is not necessary to think hardly to see that $P(occupied|talk)=1$!
Our Bayesian formula is then written as:
$P(talk| occupied)=\frac{P(occupied|talk)}{P(occupied)}P(talk)$
or simply:
$P(talk|occupied)=\frac{P(talk)}{P(occupied)}$
I actually got curious about this probability and in order to estimate it I´ll use the well-known Fermi technique of estimation.
First I assume that I´ll use the elevator in the rush hour on the morning, that is, an interval between 7.30 and 9.00 AM. From my department, I take usually around 20 seconds between enter and leave the elevator. Then using the 30 seconds interval as unit, the rush hour has 270 intervals to use the elevator.
 My building has eight floors with five apartments per floor. I estimate between 2 and 3 people living in each one. Let´s use 3 people per apartment. This result in 120 possible people using the elevator. In principle, I should discount myself, however this error is smaller than the error of my estimation of the total number of people. Let´s use 120 without further concerns. Discounting around 10% of children and retired that don´t leave in the rush hour. People on vacation constitute an average of $\frac{108 \times 10}{252} \approx 4$, that is, considering at least 10 days of vacation within an universe of 252 business days. Therefore, the sample universe of people that can occupied the elevator is 104 people.
The probability of being occupied can be simply written as (assuming homogeneous distribution of probabilities to leave the building):
$P(occupied) = \frac{108}{270} \approx 58 \%$
where 270 is the number of intervals of 20 seconds that I also could use the elevator. 
I´ve met around seven people in my building, which results in the following:
$P(talk) = \frac{7}{108} \approx 6.7%$
Finally, the probability of enter in a occupied elevator and talk to a known person is about:
$P(talk|occupied) \ approx \frac{0.067}{0.58} \approx 11.5 \%$
Notice that this estimation has been grounded by several assumptions that are certainly not realistic but are here just for the purpose of illustration.

I hope you enjoyed the post.

May the Force be with you!

#=================================
Diogo de Moura Pedroso

Comments