Sunny with a Chance of Rain: Using Bayes’ Theorem to Predict the Weather
It is November 5, 2021 and, according to the Weather app on my phone, the forecast for November 14 currently states that there is a 40% chance of rain.
What exactly does this mean? Can weather apps predict the future?
No, but they can use Bayes’ Theorem to make an educated guess.
Bayes’ theorem describes the conditional probability of an event happening given that another event has occurred. To use this theorem to determine the probability of rain on any particular day given that it was predicted to rain, we need information on past weather predictions.
Suppose the probability of rain = P(R) = 0.10
Now, suppose that 90% of rainy days in the past were correctly predicted. This gives probability of predicting rain given that it rained = P(PR|R) = 0.90
Then, suppose that 80% of clear days in the past were correctly predicted. This gives probability of predicting clear weather given that it did not rain = P(CW|NR) = 0.70. Consequently, the probability of predicting rain given that it did not rain = P(PR|NR) = 0.30.
Now we can calculate the probability of predicting rain using the law of total probability:
P(PR) = P(PR|R)P(R) + P(PR|NR)P(NR)
P(PR) = 0.90*0.10 + 0.30*0.90 = 0.36
Now, we can use Bayes’ theorem to determine the probability of it raining giving that it was predicted to rain:
P(R|PR) = P(PR|R)P(R)/P(PR)
P(R|PR) = (0.90*0.10)/0.36 = 0.25
Thus, in this scenario, the probability of it raining given that it was predicted to rain is only 25%!
This is a simplified example of the Bayes’ theorem. In real life, there are many factors that affect the probabilities above. For example, our perceived probability of rain can change depending on visual cues, the humidity in the air, and more. We can even be influenced by seeing other people carry umbrellas, which is an example of an information cascade, which occurs when multiple people make the decision sequentially regardless of their private information (for example, multiple people bringing umbrellas simply because they see someone else do it, even if their weather app does not predict rain). As a result, these probabilities can rise or fall; however, this example still provides an important lesson on the significance of considering conditions when calculating probability and how provided information can sometimes be misleading.
What should you take away from this?
Well, next time you consider bringing an umbrella with you because your weather app told you to, take a look outside and judge for yourself! Even a forecast of a 100% chance of rain isn’t quite guaranteed.
Source: https://www.linkedin.com/pulse/quick-introduction-bayes-theorem-why-weather-can-suck-awal-premi/