Re: Concurrent Curve Fitting...
- To: mathgroup at smc.vnet.net
- Subject: [mg18642] Re: Concurrent Curve Fitting...
- From: Paul Abbott <paul at physics.uwa.edu.au>
- Date: Thu, 15 Jul 1999 01:45:38 -0400
- Organization: University of Western Australia
- References: <7m6l45$2nv@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Robert Carneim wrote: > I have two sets of data which are related in such a way that, when plotted, > they should have the same shape (or I want to force the curve fits to have > the same shape), but at a different location. > So, for example (and simplicity} suppose I have two sets of data which can > be fit by lines, y=mx+b. I want to fit data set 1 to (y-y1)=m(x-x1)+b, and > data set 2 to (y-y2)=m(x-x2)+b, where m and b are common and xn and yn are > specific to the data set. Actually, it is _not_ possible to determine all these parameters for a linear fit! You certainly can determine the slope but, if you re-write the equations (y-y1)=m(x-x1)+b => y = m x + y1 + b + m x1 and (y-y2)=m(x-x2)+b => y = m x + y2 + b + m x2 you'll see that there is no way to obtain unique values for b, x1, x2, y1, and y2. However, this arbitrariness is due to the trivial nature of the linear fit. Nevertheless, there is a general approach for what you want to do. You need to simply minimize the sum of square errors (sse) for your two data sets. For a loosely related example, see http://support.wolfram.com/Math/Statistics/NDSolveFit.html Cheers, Paul ____________________________________________________________________ Paul Abbott Phone: +61-8-9380-2734 Department of Physics Fax: +61-8-9380-1014 The University of Western Australia Nedlands WA 6907 mailto:paul at physics.uwa.edu.au AUSTRALIA http://physics.uwa.edu.au/~paul God IS a weakly left-handed dice player ____________________________________________________________________