liveBook · Manning

Law of total probability

As explained in Timeless Algorithms, The Foundational Ideas

The law of total probability calculates an event's overall probability by summing its probabilities across mutually exclusive and collectively exhaustive cases.

The law of total probability finds an event’s overall probability by adding its probabilities across mutually exclusive, exhaustive cases. Before applying Bayes’ theorem to a positive test, count both ways it can occur: a diseased patient tests positive, or a disease-free patient receives a false positive. section 2.2.2

P(D)=P(D | H) × P(H)+P(D | ~H) × P(~H)

For a positive test D, add the probabilities of a positive result in each case: disease H and no disease. section 2.2.2

A rare disease and a positive test

With a disease prevalence of 0.001, sensitivity of 0.99, and false-positive rate of 0.01, the overall chance of a positive result is 0.01098. This provides the denominator for Bayes’ theorem, which gives a 9% chance of disease after a positive result. section 2.2.2

How Timeless Algorithms, The Foundational Ideas covers it

How deep it goes
Defines the case-based calculation, gives its equation, and works through a diagnostic example.
Examples
Calculates positive-test probability for a rare disease and discusses false matches from surveillance algorithms.
What you can do after
Apply it to calculate an observation’s overall probability from its possible cases.
How it connects
Connects total probability to Bayes’ theorem and prior probabilities.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Timeless Algorithms, The Foundational Ideas. The section links point to the parts of the book it draws on.