---
title: "Probability density function - pdf"
canonical: "https://modelassist.epixanalytics.com/space/EA/26574888/Probability%20density%20function%20-%20pdf"
format: markdown
---
If a random variable *X* is continuous, i.e. it may take any value within a defined range (or sometimes ranges), the probability of *X* having any precise value within that range is vanishingly small because a total probability of 1 must be distributed between an infinite number of values. In other words, there is no probability mass associated with any specific allowable value of *X*. Instead, we define a probability density function *f(x)* as:

![image](media://08f5d0e6-6e62-4c5d-a516-59ea459b9564)

> Macro (mathblock)


i.e. *f(x)* is the rate of change (the gradient) of the cumulative distribution function. Since *F(x)* is always non-decreasing, *f(x)* is always non-negative.


For a continuous distribution we cannot define the probability of observing any exact value. However, we can determine the probability of lying between any two exact values (*a, b*):

![image](media://4d61e400-4e13-4258-8c5f-ea0ea6dc2237)

> Macro (mathblock)


where *b* > *a*

### ***Example***

Consider a continuous variable that is takes a Rayleigh (1) distribution. Its cumulative distribution function is given by:

![image](media://90c04d08-69fa-4cae-9056-9eba9ba573ca)

> Macro (mathblock)


and its probability density function is given by:

![image](media://8ad2d082-8b54-4461-a0f7-2e108856bd33)

> Macro (mathblock)


The probability that the variable will be between 1 and 2 is given by:

![image](media://6d7f46d5-77ab-4384-813f-1b3bd739c545)


> Macro (mathblock)



*F(x)* and *f(x)* for are plotted below:


![image](media://fa71e14e-f428-4844-8c1e-99a35bd8fd76)




---