A function describing the relative likelihood of a continuous random variable's values.
A probability density function (PDF) is a mathematical function that characterizes the distribution of a continuous random variable by describing the relative likelihood of the variable taking on any given value. Unlike discrete probability distributions, a PDF does not assign probability to individual points — instead, probability is obtained by integrating the function over an interval. The area under the PDF curve across its entire domain equals exactly one, ensuring that all probabilities sum to unity. Common examples include the Gaussian (normal) distribution, the exponential distribution, and the beta distribution, each with distinct shapes suited to modeling different kinds of real-world phenomena.
In machine learning, PDFs are foundational to probabilistic modeling and inference. Generative models such as Gaussian Mixture Models, Variational Autoencoders, and Normalizing Flows explicitly learn or approximate the PDF of training data, enabling tasks like data synthesis, anomaly detection, and density estimation. In Bayesian inference, PDFs represent prior beliefs and posterior distributions over model parameters, allowing uncertainty to be quantified and propagated through predictions. Maximum likelihood estimation — one of the most widely used training objectives in ML — involves finding model parameters that maximize the PDF evaluated at observed data points.
PDFs also play a central role in loss function design and model evaluation. The negative log-likelihood loss, used extensively in classification and regression, is directly derived from the PDF of an assumed output distribution. Techniques like kernel density estimation use PDFs to construct non-parametric models of data distributions without assuming a fixed functional form. In reinforcement learning, policy gradient methods often model action distributions as PDFs over continuous action spaces, enabling smooth optimization via gradient ascent.
Understanding PDFs is essential for anyone working with probabilistic machine learning, as they provide the mathematical language for expressing uncertainty, modeling data-generating processes, and designing principled learning algorithms. Their utility spans virtually every subfield of modern AI, from computer vision and natural language processing to robotics and scientific machine learning.