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

Home » Public Forums » archive » Re: 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
Re: Simultaneous fitting in IDL [message #66375 is a reply to message #66374] Fri, 15 May 2009 01:28 Go to previous messageGo to previous message
Chris[6] is currently offline  Chris[6]
Messages: 84
Registered: July 2008
Member
On May 14, 6:54 am, Gianluca Li Causi <lica...@mporzio.astro.it>
wrote:
> 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/br owse_thread/thr...
>
> 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

Can't you just set the errors back to their old values before
recomputing chi-squared?
chris
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: machine precision
Next Topic: Re: machine precision

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

Current Time: Sun Oct 12 00:27:22 PDT 2025

Total time taken to generate the page: 1.72983 seconds