How to interpolate PDF(Probability Distribution Functions) from CDF (without root finding method) ?

Please tell the steps to do so.



If you have an analytical form of the CDF, you can simply take the first derivative to obtain the PDF (for a continuous distribution). If you have numerical data points representing a CDF, you can construct a numerical approximation to the first derivative by using a finite difference method. If you're going the numerical route, you should use at least a symmetric second-order finite difference, since it's just as easy as the first-order methods.

$$ PDF(x) = \frac{CDF(x+\delta x) - CDF(x-\delta x)}{2 \,\delta x} + O(\delta x^2) $$

  • $\begingroup$ In case of Numerical data points ,Suppose I have data set at a & b. So, you mean I need to calculate the differential using FD method at a& b and then interpolate for all the points in between a& b? But to calculate it , we should have close data points near a & b for CDF ? $\endgroup$ – quant1 Oct 31 '15 at 14:35
  • $\begingroup$ If you have the values of the CDF at $x=a$ and $x=b$, you will be able to most accurately calculate the value of the PDF at $x=(a+b)/2$. If you want the PDF at other locations, you will have to settle for lower accuracy or use other values of the CDF. If I were you, I'd look into how and why finite difference methods work prior to applying them. If you're willing to go out-of-field for the info, every book on numerical fluid dynamics has a very thorough treatment of finite difference methods, and how to construct them for a desired level of accuracy. $\endgroup$ – Tyler Olsen Oct 31 '15 at 15:15
  • $\begingroup$ You are right. I read somewhere that in order to carry out the FD scheme in the most efficient way , the denominator delta(x) should be equal to (12*y *e/y'''')^0.25 .Here y in numerator = CDF() y'''' is the 4th order derivative; e being a suitable presentation of machine precision. Can you please mention how to estimate e ? $\endgroup$ – quant1 Nov 1 '15 at 7:46
  • $\begingroup$ I haven't seen that formula before, and I suspect that it may have come from a slightly different finite difference method since 4th derivatives are not involved in the error term for this one. That being said, the machine epsilon is a measure of the precision used to store a number using a floating-point representation on a computer. For 64-bit floating-point numbers (default in matlab, octave, ...), you will get ~15-16 significant decimal digits (52 binary digits). Thus, the machine epsilon is $2^{-52}$. The wikipedia page has a more thorough explanation than can fit in a comment. $\endgroup$ – Tyler Olsen Nov 1 '15 at 19:36
  • $\begingroup$ As a practical matter, your data will not have sufficient resolution to use the formula that you listed. You should use the 2 data points centered around the point of interest to compute your approximation of the derivative. Your formula will likely predict a $\delta x < 10^{-15}$. $\endgroup$ – Tyler Olsen Nov 1 '15 at 19:44

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.