# Conceptual question about fitting of scattered data

What are the problems that arise when fitting (2D or 3D) a set of scattered data? (non uniformly distributed)

I had some data I had to fit and I solved the problem using the triscatteredinterp() matlab function which implements different types of methods: natural neighbor interpolations, linear interpolation and nearest-neighbor interpolation.

What I would like to understand is: what are the issues for this kind of fitting? Why should I choose a method instead of another one?

Another function is delaunay() which implements the Delaunay triangulation. What is the difference between this and the other methods?

• Are you looking for a global fit, or local interpolation? In either case, what kinds of functions are you trying to fit? A linear function, polynomials, functions nonlinear in the parameters? – Wolfgang Bangerth Dec 9 '14 at 1:06
• If 'global fit' means working with all the data it is what I meant. The data I had to fit were obtained experimentally and they showed a piece-wise linear trend – Rhei Dec 9 '14 at 5:47
• Do you want to interpolate the data or fit a model to the data? If the individual data points have measurement errors than you generally will want to fit some sort of smoothed model to the data rather than simply interpolating. – Brian Borchers Feb 4 '15 at 14:54