Re: Fitting data to a curve
- To: mathgroup at smc.vnet.net
 - Subject: [mg73260] Re: Fitting data to a curve
 - From: "ben" <benjamin.friedrich at gmail.com>
 - Date: Fri, 9 Feb 2007 02:17:25 -0500 (EST)
 - References: <eqengu$4gj$1@smc.vnet.net>
 
Hi Peter
fit = FindFit[data,
    a x^2 + b y^2 + c x y + d x + e y + f, {a, b, c, d, e, f}, {x, y}]
Please note
Fit[] = linear fit = easy&stable = no initial guess required
FindFit[] = nonlinear fit = subtle issue = initial guess helps a lot
Always check your fitting results graphically.
bye
Ben
Peter Jay Salzman schrieb:
> I have a table of {x,y} data and a function:
>
>    a y^2 + b x y + c x + d y + e  =  x^2
>
> I'd like to do a least fit to determine the constants a, b, c, d, and e.  I
> think the function I want is Fit[] or FindFit[], but I can't coax Mathematica to do
> this.  I'm not entirely sure what to do with that x^2 since it has no
> coefficient.
>
> I've never used these functions before; how can I do this least squares fit?
>
> Thanks!