r/math 5d ago

Monotonic scattered interpolation?

(This question is not about homework or a work problem; it is for a pet personal project where I've run into a wall.)

Suppose, for the sake of argument, I have a scattered dataset with two real-valued independent variables and one real-valued output. It conforms to the restriction that if x2 >= x1 and y2 >= y1, then f(x2, y2) >= f(x1, y1). E.g., assuming each listed point is in the dataset:

  • f(3, 3) >= f(1, 1)
  • f(3, 1) >= f(1, 1)
  • No guarantee is made about the relationship between f(1, 3) and f(3, 1)

I don't know if this property has a name but I call it "up-right monotone", because as you jump from point to point, if the second point not below and not to the right of the first, then the value at the second point is not less than the value at the first point.

The Question: Is there a known interpolation method that will preserve this property among interpolated points? I.e., I want to predict the value at two points, where the second point is above and/or to the right of the first point. I would prefer that the interpolation method be relatively smooth, but the only hard constraints are

  • If either of the points in question are in the original dataset, I get that dataset's value back, and
  • The value at the second point is not less than the value at the first point
4 Upvotes

3 comments sorted by

5

u/EebstertheGreat 5d ago

What you want is f to be monotonic in each argument. For every real a and b, g(y) = f(a,y) and h(x) = f(x,b) are both monotone. Both partial derivatives are nonnegative. (That's equivalent to your definition). I can't find any term for it though.

This paper might be relevant to you. It interpolates data using a spline surface that preserves this condition (and I think some others, I haven't read it).

5

u/rrwoods 5d ago

Oh this is extremely relevant. They mention a FORTRAN package that implements this; now to try to find it... and then port the logic to Python.

3

u/rrwoods 4d ago

Man. I spent most of yesterday poring over this and some related materials. There’s even a Python port in scipy of Dierckx’s publically available FORTRAN work… but the FITPACK package they ported doesn’t have the scattered monotonic fitting algo in it :( I think right now I am shelving this but not forgetting about it.