comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Simultaneous fitting in IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Simultaneous fitting in IDL [message #66384] Thu, 14 May 2009 09:54 Go to previous message
Gianluca Li Causi is currently offline  Gianluca Li Causi
Messages: 21
Registered: August 2005
Junior Member
Hi all,
I need to *simultaneously* fit two sets of data, Y1 and Y2, with two
functions, F1(X,P) and F2(X,P), having the same set of parameters P,
by using the routine LMFIT.

In order to do this I join the two datasets in a uniq vector Y=[Y1,Y2]
and do the same for the model F=[F1,F2], as suggested also by Craig
Markwardt in a past thread in this group:
http://groups.google.com/group/comp.lang.idl-pvwave/browse_t hread/thread/ba341b5169e7557f/498234b82c67279f?hl=en&lnk =gst&q=lmfit#498234b82c67279f

But my datasets contains a different number of points, N1 and N2, with
N2<<N1, so that the smaller one is almost neglected because its weight
in the uniq vector Y is proportional to N2 / N1.

SO THAT: I've tried to multiply each error vector by the SQRT of its
fraction:

Y1_err *= SQRT(N1 / (N1+N2))
Y2_err *= SQRT(N2 / (N1+N2))

and now I get a nice fit for the two dataset simultaneously!

BUT: when I compute the Reduced ChiSquare = ChiSquare / (N1 + N2 -
N_parameters) I get a completely wrong result (vey high, far from
1.0), due to my modification of the true error vector !

THUS: what I can do ?
One idea is to force the Y1 and Y2 vectors to have the same number of
elements M, which must be the minimum multiple of both N1 and N2, but
it could be a very large number.....


Could anybody help me ?!
Thanks a lot!
Gianluca
[Message index]
 
Read Message
Read Message
Previous Topic: Re: machine precision
Next Topic: Windows XP backing store error

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 09:39:21 PDT 2025

Total time taken to generate the page: 0.24215 seconds