Quantcast

[SciPy-User] Generating PDF from 'sampled' pdf

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[SciPy-User] Generating PDF from 'sampled' pdf

Jared Vacanti
I have an approximation of a PDF (by taking the derivative of an approximation of the CDF) but can't get scipy to 'interpolate' a distribution from this data. I conceptually understand the difficulty because I'm not looking at observations, but already an attempt at the PDF.

I wrote an SO question here asking the same thing - http://scicomp.stackexchange.com/questions/25311/python-differentiating-cubic-spline-numerically-or-analytically . The link contains a SSCCE with actual data, but I would like to be able to apply this to other areas of research as well.

Can I fit a probability density function to my attempted "sampled" collection of one?

Jared Vacanti

_______________________________________________
SciPy-User mailing list
[hidden email]
https://mail.scipy.org/mailman/listinfo/scipy-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Generating PDF from 'sampled' pdf

josef.pktd


On Tue, Oct 25, 2016 at 5:16 PM, Jared Vacanti <[hidden email]> wrote:
I have an approximation of a PDF (by taking the derivative of an approximation of the CDF) but can't get scipy to 'interpolate' a distribution from this data. I conceptually understand the difficulty because I'm not looking at observations, but already an attempt at the PDF.

I wrote an SO question here asking the same thing - http://scicomp.stackexchange.com/questions/25311/python-differentiating-cubic-spline-numerically-or-analytically . The link contains a SSCCE with actual data, but I would like to be able to apply this to other areas of research as well.

Can I fit a probability density function to my attempted "sampled" collection of one?


I didn't look carefully, but the first thing I would try is giving up on interpolation and use a smoothing spline instead, trying some s > 0.
If you want to have derivatives without a lot of variation, then I think reducing the number of knots would help given that
your underlying functions looks pretty smooth.

scipy has monotonic splines also, if needed.

Josef

 

Jared Vacanti

_______________________________________________
SciPy-User mailing list
[hidden email]
https://mail.scipy.org/mailman/listinfo/scipy-user



_______________________________________________
SciPy-User mailing list
[hidden email]
https://mail.scipy.org/mailman/listinfo/scipy-user
Loading...