Re: Find a function that fits two dimensional data

• To: mathgroup at smc.vnet.net
• Subject: [mg67288] Re: Find a function that fits two dimensional data
• From: Bill Rowe <readnewsciv at earthlink.net>
• Date: Thu, 15 Jun 2006 03:27:09 -0400 (EDT)
• Sender: owner-wri-mathgroup at wolfram.com

```On 6/14/06 at 6:28 AM, rajanikanth at gmail.com (Raj) wrote:

>Could somebody help me find a function that fits some two
>dimensional data that I have..the data is of the form {x,y,f(x,y)}
>and so far the function aa/(bb+cc Exp[-dd xy]) (where aa,bb,cc,dd
>are constants) seems to fit the data best but it is not quite
>accurate fit. I have used findfit to find this function. Is there a
>better way to find an exact function or should I keep experimenting?

There are quite literally an infinite number of functions that can be fit to any finite set of data. The only way to offer meaningful suggestions toward finding a useful function requires either I make some assumptions about your intended purpose, or for you to provide more information as to what you want to accomplish.

By default, FindFit minimizes Sum[f[x[[k]],y[[k]]-z[[k]])^2,{k,n}] where f is the function you are fitting and z is the value you have for the x,y pair. When the values at each x,y pair can be represented as a "true" value plus an error term and the error term has a normal distribution, minimizing this Sum results in the maximum likelihood estimates for the parameters of f. With this model, the functions in Statistics`NonLinearRegression` can be used to generate diagnostics to assess how well the model fits the data.

Optimal usage of FindFit and non-linear regression techniques require you to know something about the form of the function that describes the data.

There are other approaches to fitting data that don't require you to know something about the function you are looking for. For example, a smoothed spline can be fit to the data. In this approach, no attempt is made to find the "true" function that describes the data. Instead, an approximation is made using a spline with a smoothing parameter.

Perhaps your data is such that it can be considered error free. Then Interpolation might be a better choice to use rather than FindFit. Interpolation fits a piecewise polynomial to your data (by default, cubic) guaranteed to pass through all of your data points. This will always give a reasonable estimate for z values near the x,y pairs you have. But will not provide reasonable estimates outside the range of x,y values you have.

Provide some more information as to what you are attempting and how you intend to use the fitted function and someone here can likely give more specific suggestions.
--
To reply via email subtract one hundred and four

```

• Prev by Date: Re: Determining continuity of regions/curves from inequalities
• Next by Date: Re: dynamic variable definiton
• Previous by thread: Re: Find a function that fits two dimensional data
• Next by thread: Re: Find a function that fits two dimensional data