liveBook · Manning

Cumulative distribution function

As explained in Grokking Bayes

A cumulative distribution function returns the probability that a random variable is less than or equal to a specified threshold.

A cumulative distribution function (CDF) answers a threshold question: how probable is it that a random variable is at or below a chosen value? For a continuous variable, it accumulates the area under the probability density function (PDF) from negative infinity through that threshold. section 3.8

Use one CDF to calculate several useful probabilities:

  • CDF(x) gives the probability that the variable is less than or equal to x. section 3.8
  • 1 − CDF(x) gives the probability that the variable exceeds x. section 3.8
  • CDF(upper) − CDF(lower) gives the probability that the variable lies between two thresholds. section 3.8

Posterior threshold questions

Suppose a beta posterior describes the proportion of coworkers who prefer tea. To estimate the probability that the proportion exceeds 0.8, calculate 1 − beta.cdf(0.8, post_a, post_b), which returns about 0.09888 in the example. For the probability between 0.2 and 0.4, subtract beta.cdf(0.2, post_a, post_b) from beta.cdf(0.4, post_a, post_b), obtaining about 0.16224. section 3.8

from scipy.stats import beta
1 - beta(a, b).cdf(0.1)

Use the SciPy listing to evaluate a posterior tail probability directly; the same pattern answers whether a conversion rate exceeds 0.1. section 11.10

How Grokking Bayes covers it

How deep it goes
Defines PDF integration, complements, and interval differences, then demonstrates SciPy code; it defers the underlying analytical mathematics.
Examples
Uses tea preferences, beta posteriors, Monte Carlo samples, and conversion-rate thresholds such as 0.1 and 0.05.
What it assumes
Assumes probability distributions and posterior quantities, while introducing continuous-PDF integration from the threshold question upward.
What you can do after
Apply it via SciPy to compute posterior tail and interval probabilities from closed-form or sampled distributions.
How it connects
Connects probability density functions, posterior distributions, beta distributions, Monte Carlo sampling, and Bayesian hypothesis testing.

Also explained in

Compare how 5 books explain cumulative distribution function →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Bayes. The section links point to the parts of the book it draws on.