[SciPy-User] inverse function of a spline

josef.pktd at gmail.com josef.pktd at gmail.com
Fri May 7 12:40:05 EDT 2010


I have a function  y = f(x) which is monotonically increasing (a
cumulative distribution function)
f is defined by piecewise polynomial interpolation, an interpolating
spline on some points

I would like to get the inverse function (ppf)  x = f^{-1} (y)
if the spline is of higher order than linear

In the linear case it's trivial, because the inverse function is also
just a piecewise linear interpolation.

If I have a cubic spline, or any other smooth interpolator in scipy,
is there a way to get the
inverse function directly?

I don't know much about general properties of splines, and would
appreciate any hints,
so I can avoid numerical inversion (fsolve or similar)

Thanks,

Josef



More information about the SciPy-User mailing list