0

I have a function Y = constant + Beta I-Spline(X). All the Beta are > 0, and I use i-splines (integral of M-spline), which guarantees that f(X) = beta*I-Spline(X) is strictly increasing in X. I wonder if there is a way to INVERT f(X) (e.g., a closed form formula for the inverse, given the beta - or if not a closed form, a way to compute it quickly)? Because I need to get X=f^-1(Y), so I need to know the inverse function. So far, I'm estimating f^-1 by estimating f(X) on a grid and doing a reverse interpolation, but that's quite messy, and approximative at some points. I'm working in R.

G. Ander
  • 167
  • 7
  • I think the exact inverse part is more of a stats question rather than a programming question, but maybe polyroot() would work for you if you can express the splines as piecewise polynomials. For approximation, you could use uniroot(). – user2554330 Mar 30 '24 at 17:37
  • 2
    Re "compute it quickly:" use any decent root finder. Since most splines are differentiable, you can use those that exploit differentiability. They will be fast. See my implementation of q.generic at https://stats.stackexchange.com/a/411671/919, for instance, which can readily be adapted for any increasing function with a known range. – whuber Mar 30 '24 at 18:29

0 Answers0