# The probability density function

## In words...

A probability density function (pdf) is a positive function encoding the distribution of a continuous random variable: high values of the pdf coincide with locations of high probability for the value of the random variable.

The sum of the pdf over all possible values of the random variable is 1, since it corresponds to the probability of the random variable taking any value.

## In picture...

...

### The Gaussian pdf

Here is a plot of the Gaussian pdf.

The red area under the curve corresponds to the probability of the random $X$ taking a value in the interval $[a,b]$:

$P_X([a,b] ) =$

Use the mouse to drag-and-drop the mean $\mu$, the standard deviation $\sigma$ or the bounds of the interval $[a,b]$.

## In maths...

The probability density function (pdf) of a continuous random variable $X$ taking values in $\X$ is a positive function $$p_X (x) : \X \rightarrow [0,+\infty)$$ such that, for all $A\subseteq \X$, $$P(X \in A) = P_X(A) = \int_A p_X(x) dx ,$$ where $P$ is the probability measure of the former probability space $(\Omega, \Sigma, P)$ and $P_X$ is the probability distribution of $X$, i.e., the probability measure for the probability space $(\X, \mathcal{B}(\X), P_X)$.

Note that this definition emphasizes the fact that, for any value $a\in\X$, the probability of a continuous random variable taking this precise value is zero. For instance, if $\X\subseteq\R$, we have $$P(X=a) = P_X(a) = \int_a^a p_X(x) dx = 0 .$$

Another property of the pdf is that it sums to one: $$\int_{\X} p_X(x) dx = P_X(\X) = 1 ,$$ due to the fact that the probability measure of the sample space is one.