---
title: "probability density function"
type: concept
related: [Probability Mass Function, Probability, Probability Density Function]
source: https://www.jemoka.com/posts/kbhprobability_density_function/
confidence: high
status: active
---

PDFs is a function that maps continuous random variables to the corresponding probability.
\begin{equation} P(a &lt; X &lt; b) = \int_{x=a}^{b} f(X=x)\dd{x} \end{equation}
note: \(f\) is no longer in units of probability!!! it is in units of probability scaled by units of \(X\). That is, they are DERIVATIVES of probabilities. That is, the units of \(f\) should be \(\frac{prob}{unit\ X}\). So, it can be greater than \(1\).
We have two important properties:
if you integrate over any bounds over a probability density function, you get a probability if you integrate over infinity, the result should be \(1\) getting exact values from PDF There is a calculus definition for \(P(X=x)\), if absolutely needed:
\begin{equation} P(X=x) = \epsilon f(x) \end{equation}
mixing discrete and continuous random variables Let&rsquo;s say \(X\) is continuous, and \(N\) is discrete.
We desire:
\begin{equation} P(N=n|X=x) = \frac{P(X=x|N=n)P(N=n)}{P(X=x)} \end{equation}
now, to get a specific value for \(P(X=x)\), we can just multiply its PMF by a small epsilon:
\begin{align} P(N=n|X=x) &amp;= \lim_{\epsilon \to 0} \frac{\epsilon f(X=x|N=n)P(N=n)}{\epsilon f(X=x)} \\ &amp;= \frac{f(X=x|N=n)P(N=n)}{f(X=x)} \end{align}
this same trick works pretty much everywhere&mdash;whenever we need to get the probability of a continuous random variable with
