Notes

Cumulative Distribution Function (CDF)

The Cumulative Distribution Function (CDF) is a way to describe “how much probability has piled up” up to a certain value. If you pick a random outcome, the CDF tells you the chance that it lands at or below a threshold you care about.

What it means, technically
For a random variable X, the CDF is the function F(x) = P(X &le x). As you move x from left to right, F(x) can only stay the same or increase, because probability only accumulates. It always ranges from 0 to 1:

  • Far below all likely values, F(x) ≈ 0
  • Far above all likely values, F(x) ≈ 1
For continuous variables, the CDF is smooth and its slope is the probability density function (PDF). For discrete variables, it increases in jumps, with jump sizes equal to the probability mass function (PMF).

Everyday examples

  • House prices: If F(500k)=0.72, then 72% of houses cost $500k or less.
  • Exam scores: If F(80)=0.60, then 60% of students scored 80 or below.
  • Medical measurements: A CDF can answer “What fraction of patients have blood pressure ≤ 140?”
You can also get “between” probabilities from the CDF: P(a < X \le b) = F(b) - F(a).

Why it matters in AI/ML
CDFs show up whenever models need probabilistic thresholds or quantiles:

  • Calibration and uncertainty: turning model scores into meaningful probabilities.
  • Quantile regression and prediction intervals: using the inverse CDF to get percentiles (e.g., 90th percentile demand).
  • Sampling: inverse-transform sampling draws values from a distribution using its CDF.
Commonly encountered in SciPy (scipy.stats) and many probabilistic ML tools.

Cumulative Distribution Function (CDF) gives the probability that a random variable is less than or equal to a value x: F(x)=P(X≤x). It fully characterizes a probability distribution and works for both discrete and continuous variables (as a nondecreasing function from 0 to 1). In AI/ML, CDFs support probabilistic modeling, uncertainty quantification, and sampling/thresholding decisions. Example: use a model’s predictive CDF to compute P(y≤t) for risk scoring.

Imagine you’re filling a jar with marbles sorted by size. As you allow bigger and bigger marbles, you can keep track of how many marbles are “small enough” to be included so far. A Cumulative Distribution Function (CDF) does the same idea for chance.

For any number you pick, the CDF tells you the probability that a random value is less than or equal to that number. For example, if a model predicts delivery times, the CDF at 30 minutes might say “there’s a 80% chance the delivery arrives within 30 minutes.” It’s a simple way to see how probability builds up as values increase.