EconForge / interpolation.py

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

Should report error for CubicSplines when dim>4 #37

Closed YuuuXie closed 4 years ago

YuuuXie commented 5 years ago

I am using this package to do a 6-D interpolation using CubicSplines, but it didn't tell me that the interpolation for n-D (n>4) is not supported. So I could get a spline function which does not work normally (but can still output numbers without reporting error).

Then I switched to multilinear and it reported that I can't do interpolation higher than 5 dimensions. Thus I got to know where's the problem.

I think you need to add this error report. BTW, I looked at the source code. It seems cumbersome to write functions for each dimension. Do you have any approach to unify it, so that it can work for any dimensions?

(Also, I really need the 6-D cubic interpolation, if you can add it I will appreciate it very much!)

albop commented 5 years ago

Hey @YuuuuXie : you comment is quite timely. Over the last few months, some functions were rewritten in order to generate the code just in time. There is a new multilinear interpolation routine which works with d>4. This is also true for cubic evaluation, but not yet for cubic filtering. I'm opening a special issue for that.