I have some data in a form data = {{x,y,f[x,y]},...}, where f[x,y] takes only positive values. When I try to interpolate it, Interpolation[data], interpolated function has negative values at particular points, like on the plot. Is there some way to interpolate the data with forced condition to take only positive values (not involved InterpolationOrder->0)?
Asked
Active
Viewed 144 times
2
J. M.'s missing motivation
- 124,525
- 11
- 401
- 574
John Taylor
- 5,701
- 2
- 12
- 33
-
1You could try using a monotonic interpolation method (e.g. Steffen) to compute the gradients in one direction. – J. M.'s missing motivation Sep 24 '18 at 19:07
-
1You could take the log of the data, interpolate and then exponentiate. This is guaranteed to be positive, but you will have to judge the fit for yourself. – mikado Sep 24 '18 at 19:38
