help-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re:Re: [Help-gsl] about nonlinear fit of several functions simultaneousl


From: wendeliu
Subject: Re:Re: [Help-gsl] about nonlinear fit of several functions simultaneously
Date: Tue, 27 Jul 2010 20:33:44 +0800 (CST)

Hi,

Thanks a lot! Actually, I met another situation in the so called ellipsometry. 
There people often do like this: evaluate ki_squared as the sum over 
[F1(i)-f1(i)]^2+[F2(i)-f2(i)]^2 then divided by (2N-P) where N is the number of 
f1(or f2) and P the number of parameters. I just wonder whether this can be 
extended to a more generall case where one has M dataset to be fitted and 
ki_squared = 1/(M*N-P)*sum{(F1-f1)^2+(F2-f2)^2+...(FM-fM)^2}. How about this 
approach?

Liu


在2010-07-27 19:26:20,"Francesco Abbate" <address@hidden> 写道:
>2010/7/25 nim <address@hidden>:
>> Hi,all
>> I have datasets {f1, f2} over [X0,X1]. The task is to fit {f1,f2} 
>> simultaneously by assuming two function F1(a,b) and F2(a,b) where {a,b} are 
>> common parameters. How to realize this with the gsl Levenberg-Marquardt 
>> solver? I have used it for a single dataset (i.e., only {f} over [X0,X1]}. 
>> The solver seems to be designed for fitting only one function.
>>
>> I have an idea that a piecewise function can be defined and thus fitted 
>> piecewisely. Is this right?
>>
>> Does anyone have any idea for dealing with this?
>> Or can anyone recommend other library that can easily deal this situation?
>> thanks in advance
>> Liu
>
>Hi,
>
>I use GSL for the same kind of problem and the solution I've adopted
>is what you describe as a "piecewise" function. So, to be more
>precise, the first function f1 was sampled over N points and the same
>for the function f2. I've therefore created a non-linear solver for
>2*N data points and in the first N points I evaluate the function f1
>while in the following N point I evaluate the function f2.
>
>It does works perfectly and I believe it is correct also because the
>GSL routine does not have the concept of an independent "x" variable
>but it just require to have N values f_i for i that goes from 1 to N
>and it does evaluate f_i versus y_i (or f_i versus 0). In this model
>the i variable can cover the samples over a single continuous variable
>"x" but you can also use it differently. You can actually have many
>indipendent variables (a, b, c, d, ...) and the index "i" can span
>just different observations for different values of the indipendent
>variables. The GSL model for non-linear fit is therefore more general
>that just the case y = f(x) and it can accomodate for other kind of
>utilisation.
>
>I hope that helps.
>
>Best regards,
>Francesco
>
>
>This email and any files transmitted with it are confidential and intended 
>solely for the use of the individual or entity to whom they are addressed.
>
>If you have received this email in error please notify the originator of the 
>message.
>
>Any views expressed in this message are those of the individual sender.
>
>This message has been scanned for viruses and spam by Websense RiskFilter.
>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]