Re: Best fit surface
- To: mathgroup at smc.vnet.net
 - Subject: [mg26356] Re: Best fit surface
 - From: Erich Mueller <emuelle1 at uiuc.edu>
 - Date: Wed, 13 Dec 2000 02:41:17 -0500 (EST)
 - Organization: University of Illinois at Urbana-Champaign
 - References: <914nl3$e51@smc.vnet.net>
 - Sender: owner-wri-mathgroup at wolfram.com
 
The syntax is almost the same as for 1-D:
Data = Table[{i, j, 3 i + j + 2 i j + Random[]}, {i, 1, 5}, {j, 1, 5}]~Flatten~1
MF = Fit[Data, {x, y, x y}, {x, y}]
yields 
3.14135 x + 1.14237 y + 1.97038 x y
Erich
On 12 Dec 2000, John Lai wrote:
> Hello all,
> If I have a set of points (xi,yi} where i=1 to n
> and I want to find a best fit curve (say mth order polynomial) that
> describes these data points, I could use the following commands.
> data = {{x1,y1},{x2,y2},...,{xn,yn}}
> Fit[data,{1,x,x^2,...,x^m},s]]
> 
> Now I have a set of 3D points {xi,yi,zi} and I want to plot the surface
> describe by these points and to find the equation that describe this
> surface.  Is there a similar way to do what I have described above for 2D?
> 
> Thanks in advance,
> John Lai
> 
> 
>