Re: Is zero-degree fitting possible? [message #6024 is a reply to message #6019] |
Wed, 10 April 1996 00:00  |
korpela
Messages: 59 Registered: September 1993
|
Member |
|
|
In article <4kgkvb$kpj@lastactionhero.rs.itd.umich.edu>,
Khai Trinh Pham <kpham@umich.edu> wrote:
>
> I am having problems doing a very simple zero-degree fit, i.e. fitting
> only one parameter. I've tried POLY_FIT, CURVEFIT, and SVDFIT.
> They each return the following error:
>
> IDL> F = POLY_FIT(Ycalculated, Yexperiment, 0)
> % INVERT: Input must be a square matrix: A.
> % Error occurred at: POLY_FIT 79 @IDL_DIR:[LIB]LIB.TLB(POLY_FIT)
The internal invert function cannot invert a 1x1 array. Kind of silly.
> I just want to find F such that (F * Ycalculated) gives the best fit
> to (Yexperiment).
>
> Am I missing something really simple here?
It looks to me that what you want is....
f=total(Yexperiment)/total(Ycalculated)
Which is the solution to
n
---
> ( f*y_c -y_e) = 0
---
0
or better yet, minimize the rms of (f*y_c-y_e) which would
give you.....
f=total(Yexperiment*Ycalculated)/total(Ycalculated*Ycalculat ed)
Eric
--
Eric Korpela | An object at rest can never be
korpela@ssl.berkeley.edu | stopped.
<a href=" http://www.cs.indiana.edu/finger/mofo.ssl.berkeley.edu/korpe la/w">
Click here for more info.</a>
|
|
|