[SciPy-User] Interpolated Univariate Spline - what are coefs, and how is integral calculated?
Andrew Nelson
andyfaff at gmail.com
Wed Aug 10 23:40:16 EDT 2016
I have a few questions about interpolate.InterpolatedUnivariateSpline (IUS).
My ultimate aim, given an IUS object, a lower definite integration limit,
and an area, is to obtain the upper definite integration limit by the
fastest route possible.
The application is to do with probability distribution functions. The IUS
represents the PDF. I can quickly work out the CDF using IUS.integral(a, x)
= q, where a is the lower limit of support and x is the value for which you
want to work out the CDF.
However, I would like the quickest way to calculate the percent probability
function (PPF). I.e. given q, work out x.
One way used in scipy.stats is to use optimize.brentq to find this value -
It's known that the CDF is a monotonically increasing function. It strikes
me that brentq might not be the fastest way of achieving this. For example,
I could cache the integral at each of the datapoints for the IUS, which
would immediately allow me to bracket the location of x. Given that I know
the degree of the smoothing spline I am hoping to calculate x quickly if I
know the polynomial coefficients of the spline in the bracketing interval.
This would done by integrating the polynomial and using the roots of the
integral. My question is: Is there a way of getting those polynomial
coefficients for each interval from the output of the IUS.get_coeffs method?
--
_____________________________________
Dr. Andrew Nelson
_____________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20160811/cfdb000a/attachment.html>
More information about the SciPy-User
mailing list