How can I find the PDF (probability density function) of a distribution given the CDF (cumulative distribution function)?

  • 7
    $\begingroup$ I am not sure I understand the difficulty. If the functional form is known just take the derivative otherwise take differences. Am I missing something here? $\endgroup$ – user28 Jul 19 '10 at 19:31
  • 1
    $\begingroup$ I am guessing the question is about multivariate case. $\endgroup$ – user1700890 Aug 5 '15 at 23:28

As user28 said in comments above, the pdf is the first derivative of the cdf for a continuous random variable, and the difference for a discrete random variable.

In the continuous case, wherever the cdf has a discontinuity the pdf has an atom. Dirac delta "functions" can be used to represent these atoms.

  • $\begingroup$ There is a nice online textbook by Pishro-Nik here showing this more explicitly. $\endgroup$ – gwr Nov 28 '15 at 11:29
  • $\begingroup$ Does something similar hold for multivariate case? (I found the answer here page 9). $f(\mathbf x) = \frac{\partial^n F(\mathbf x)}{\partial x_1 \dots \partial x_n}$ $\endgroup$ – MInner Oct 30 '17 at 15:36

Let $F(x)$ denote the cdf; then you can always approximate the pdf of a continuous random variable by calculating $$ \frac{F(x_2) - F(x_1)}{x_2 - x_1},$$ where $x_1$ and $x_2$ are on either side of the point where you want to know the pdf and the distance $|x_2 - x_1|$ is small.

  • 1
    $\begingroup$ Thats the same as taking the derivative, but just more inaccurate so why would you do it? $\endgroup$ – Matti Pastell Jul 20 '10 at 9:39
  • 6
    $\begingroup$ This would be the approach when the CDF is only approximated empirically. It gives lousy estimates of the PDF, though. $\endgroup$ – shabbychef Oct 20 '10 at 5:13
  • $\begingroup$ Given CDF percentile values, is there a better way to calculate PDF from these discrete values ? $\endgroup$ – bicepjai Jul 23 '18 at 17:41
  • $\begingroup$ In this case, are all x from x1 to xn sorted in an ascending order first so that it is always xn>x(n-1)>x(n-2)>…..x3>x2>x1? $\endgroup$ – Eric Oct 2 '18 at 14:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.