EconForge / interpolation.py

BSD 2-Clause "Simplified" License
123 stars 35 forks source link

Extrapolation with class interface #43

Closed pkofod closed 4 years ago

pkofod commented 5 years ago

Is it correct, that you cannot chose extrapolation scheme for the LinearSpline and the other "class interfaces"? Is it a planned feature to make "interpolants" where you can also specify extrapolation behavior?

albop commented 5 years ago

We can plan it if you want. Should be trivial to implement. The other idea would be to revamp the whole class interface which hasn't received much love recently.

On Wed, Mar 20, 2019 at 10:32 PM Patrick Kofod Mogensen < notifications@github.com> wrote:

Is it correct, that you cannot chose extrapolation scheme for the LinearSpline and the other "class interfaces"? Is it a planned feature to make "interpolants" where you can also specify extrapolation behavior?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/EconForge/interpolation.py/issues/43, or mute the thread https://github.com/notifications/unsubscribe-auth/AAQ5KQe1gdc86mR1qZ42b1Tfas8Y-97pks5vYqjxgaJpZM4cAT8n .

pkofod commented 5 years ago

We can plan it if you want. Should be trivial to implement.

Right, I just wanted to make sure I hadn't missed anything. On a related note. If you have, say, a LinearSpline instance, it isn't possible to extract the derivative at some point either, right?

In the HARK use-case, an "interpolant" object is important. You've also mentioned things like setup of more advanced interpolation schemes than multilinear can be significant if you're going to be re-using the same interpolant many times (say one point at a time). So I was just trying to gauge how "polished" the "interpolant" versus the "interpolate onto these values based on this input" case was in interpolation.py.

In the end, if this is not the ultimate goal of interpolation.py, the "wrappers" could even exist outside (say somewhere in hark) where you can tailor it to your own needs, and have interpolation.py be the "fast underlying interpolation scheme compiler". I'm not sure what your preferred role of the package is.