# A problem when interpolating the data

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)?

• You could try using a monotonic interpolation method (e.g. Steffen) to compute the gradients in one direction. – J. M. is away Sep 24 '18 at 19:07
• You 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