ApX logoApX logo
ModelsCalculatorHardwareCoursesPricing
ApX logoApX logo
ModelsCalculatorHardwareCoursesPricing

All Courses

Probability & Statistics Fundamentals for Machine Learning
Chapter 1: Introduction to Probability and Statistics for Machine Learning
What are Probability and Statistics?
Relevance in Machine Learning
Understanding Data Types
Populations and Samples
Setting Up the Python Environment
Hands-on Practical: Loading and Inspecting Data
Quiz for Chapter 1
Chapter 2: Descriptive Statistics: Summarizing Data
Measuring the Center: Mean, Median, and Mode
Measuring Spread: Range
Measuring Spread: Variance and Standard Deviation
Understanding Percentiles and Quartiles
Visualizing Distributions: Histograms
Visualizing Summaries: Box Plots
Calculating Descriptive Statistics with Python
Practice: Summarizing a Dataset
Quiz for Chapter 2
Chapter 3: Basic Probability Concepts
Understanding Probability: Events and Sample Spaces
Calculating Simple Probabilities
Introduction to Set Theory for Probability
Conditional Probability Explained
Independent vs. Dependent Events
Introduction to Bayes' Theorem
Practice: Probability Calculations
Quiz for Chapter 3
Chapter 4: Probability Distributions
What are Probability Distributions?
Probability Mass Function (PMF) for Discrete Distributions
Discrete Distribution: Bernoulli
Discrete Distribution: Binomial
Probability Density Function (PDF) for Continuous Distributions
Continuous Distribution: Uniform
Continuous Distribution: Normal (Gaussian)
The Central Limit Theorem
Generating Samples from Distributions using Python
Practice: Working with Distributions
Quiz for Chapter 4
Chapter 5: Introduction to Statistical Inference
Drawing Conclusions from Data
Point Estimation
Interval Estimation: Confidence Intervals
Hypothesis Testing: The Basic Idea
Null and Alternative Hypotheses
Understanding P-values
Connecting Inference to Machine Learning Evaluation
Practice: Interpreting Statistical Results
Quiz for Chapter 5

Probability Density Function (PDF) for Continuous Distributions

Probability Mass Functions (PMFs) describe discrete random variables, for example, the number of heads in three coin flips. For discrete variables, all possible outcomes can be listed, and a specific probability is assigned to each one. The PMF provides P(X=x)P(X=x)P(X=x), the probability that the random variable XXX takes on the exact value xxx.

But what happens when the variable can take on any value within a continuous range? Think about measuring someone's exact height, the precise temperature, or the time it takes for a process to complete. These are continuous random variables. If we tried to assign a probability to a single, infinitely precise value (like a height of exactly 175.0000... cm), the probability would effectively be zero. There are simply too many possibilities!

Instead of focusing on the probability of a single point, for continuous variables, we talk about the probability of the variable falling within a specific interval. This is where the Probability Density Function (PDF) comes in.

Understanding the Probability Density Function (PDF)

The PDF, often denoted as f(x)f(x)f(x), is a function that describes the relative likelihood for a continuous random variable to take on a given value. Unlike the PMF, the value of the PDF at a specific point xxx, f(x)f(x)f(x), is not a probability itself. Instead, the area under the curve of the PDF between two points, say aaa and bbb, represents the probability that the random variable XXX falls within that interval [a,b][a, b][a,b].

Mathematically, this is expressed using an integral:

P(a≤X≤b)=∫abf(x)dxP(a \le X \le b) = \int_{a}^{b} f(x) dxP(a≤X≤b)=∫ab​f(x)dx

Don't worry if you haven't seen the ∫\int∫ symbol or calculus before. The important concept is that Area = Probability. For many standard distributions we'll encounter, we won't need to perform the integration manually; we can use tables or software functions.

Think of it like this: imagine a histogram for a very large dataset with continuous values. As you make the bins smaller and smaller, the tops of the bars start to form a smooth curve. This smooth curve represents the PDF. The height of the curve at any point indicates where values are more densely clustered.

Properties of a PDF

A valid PDF must satisfy two main properties:

  1. Non-negativity: The density function must always be greater than or equal to zero for all possible values of xxx. You can't have negative likelihood. f(x)≥0 for all xf(x) \ge 0 \text{ for all } xf(x)≥0 for all x
  2. Total Area is 1: Since the random variable must take on some value, the total area under the entire curve of the PDF must equal 1. This represents 100% probability. ∫−∞∞f(x)dx=1\int_{-\infty}^{\infty} f(x) dx = 1∫−∞∞​f(x)dx=1

Interpreting the PDF

It's important to remember:

  • The value f(x)f(x)f(x) represents density, not probability. A higher value of f(x)f(x)f(x) compared to f(y)f(y)f(y) means the variable is more likely to be found in a small interval around xxx than in an equally small interval around yyy. It's possible for f(x)f(x)f(x) to be greater than 1 for some distributions, as long as the total area under the curve remains 1.
  • For a continuous variable XXX, the probability of it taking any single specific value is zero: P(X=c)=0P(X = c) = 0P(X=c)=0. This is because there's no "area" under the curve at a single point (an interval from ccc to ccc has zero width). This also means P(a≤X≤b)P(a \le X \le b)P(a≤X≤b) is the same as P(a<X<b)P(a < X < b)P(a<X<b).

Let's visualize this. For example, a generic PDF curve:

The shaded region represents the probability P(2≤X≤4)P(2 \le X \le 4)P(2≤X≤4). This probability is equal to the area under the blue curve between x=2x=2x=2 and x=4x=4x=4. The height of the curve f(x)f(x)f(x) indicates the density of probability around the value xxx.

PDF vs. PMF: A Quick Comparison

Feature PMF (Discrete) PDF (Continuous)
Applies to Discrete Random Variables Continuous Random Variables
Function Value P(X=x)P(X=x)P(X=x) (Probability at a point) f(x)f(x)f(x) (Density at a point)
Probability Sum of PMF values over a set Area (Integral) under PDF over interval
Value Range 0≤P(X=x)≤10 \le P(X=x) \le 10≤P(X=x)≤1 f(x)≥0f(x) \ge 0f(x)≥0 (can be > 1)
Sum/Integral ∑all xP(X=x)=1\sum_{\text{all } x} P(X=x) = 1∑all x​P(X=x)=1 ∫−∞∞f(x)dx=1\int_{-\infty}^{\infty} f(x) dx = 1∫−∞∞​f(x)dx=1

Understanding PDFs is significant when working with continuous measurements in machine learning. Many algorithms assume that features follow certain distributions (like the Normal distribution, which we'll see next), and PDFs allow us to model and work with these continuous quantities effectively. They help us quantify uncertainty and make probabilistic statements about continuous outcomes.

  • Applied Statistics and Probability for Engineers, Douglas C. Montgomery, George C. Runger, 2018 (Wiley) - Covers the fundamentals of probability distributions, including continuous random variables and their probability density functions, with an emphasis on applications relevant to data science.
  • All of Statistics: A Concise Course in Statistical Inference, Larry Wasserman, 2004 (Springer) - A concise yet rigorous textbook covering statistical inference concepts, including a thorough discussion of probability density functions, suitable for readers with a strong mathematical interest.
  • Lecture Notes on Continuous Random Variables and PDFs, Scott Sheffield, 2014 (MIT OpenCourseWare) - Provides lecture materials from a foundational MIT course, offering a clear explanation of continuous random variables and probability density functions with examples and illustrations.

© 2026 ApX Machine Learning