Using GlobalFit to evaluate differences between two different fitting functions

Hi,

I have two different fitting functions which they both have the same first fitting coefficient, but different second one. I want to use them as fitting functions on same data sets. So, for each data set I have to use both functions. Here are my questions regarding this case:
1) What are the benefits of using GlobalFit in contrast to regular separate curve fitting with FuncFit, or is just faster method?
2) Is in this case useful to use GlobalFit like in case of two different functions for two different data sets?
3) What do you recommend to use for comparison of two different fitting functions only in one parameter on the same data set?

Thank you for all information and advices.

Best,
Dejan
arzensekd wrote:
I have two different fitting functions which they both have the same first fitting coefficient, but different second one. I want to use them as fitting functions on same data sets. So, for each data set I have to use both functions.

I'm not sure I understand- do you mean that you need to fit a single data set with two functions? If you are fitting a single data set, Global Fit will not help.

But perhaps you need to fit a sum of the two functions? If so, just write a new user-defined fit function that adds the two functions together.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
johnweeks wrote:

I'm not sure I understand- do you mean that you need to fit a single data set with two functions? If you are fitting a single data set, Global Fit will not help.


I know that I can combine two different functions with different sample data, but I am thinking for two functions with one same term with same parameter and one term is different with different second parameter. The same parameter I want to link. I have eight different experimental sets of data which they correspond for each different fitting parameter. But, for each different set I want to use both functions. Will I get any benefits with using GlobalFit in this case?

Thanks,
Dejan
Dear Dejan,
you want to fit the same dataset with two different functions. Normally using Global fit would not give you anything extra. However, in this case one of the parameters needs to be the same for the two different functions. Therefore, you can use Global Fit for what you are trying to do.

A.
It still sounds to me like writing a third user-defined fitting function is what you're describing. A simple skeleton:

Function func1(A, B, x)
    Variable A, B, x

    return <expression involving A, B and x>
end

Function func2(A, C, x)
    Variable A, C, x

    return <expression involving A, C and x>
end

Function FitFunc1PlusFunc2(w, x)
    Wave w
    Variable x

    return func1(w[0], w[1], x) + func2(w[0], w[2], x)
end

Is that not what you want?

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
If you want fitting results that are self-consistent with regards to one or more variables, you would need to "link" the variables that are identical in each function. This can be accomplished on the coefficients dialog on the right side of the Global Analysis "Data sets and functions" panel.
johnweeks wrote:
It still sounds to me like writing a third user-defined fitting function is what you're describing.

No, I don't want this. I attached the experiment file where can you see my globalfit window with all the settings and how the functions look like. @andyfaff already explained what I want. Is it the way to handle this problem also the writting of third fitting function?

In the attached experiment I did like it was suggessted in previous post:
mtaylor wrote:
If you want fitting results that are self-consistent with regards to one or more variables, you would need to "link" the variables that are identical in each function. This can be accomplished on the coefficients dialog on the right side of the Global Analysis "Data sets and functions" panel.
, but when I executed the fit in this way I got the resulting fit waves only for one fitting function and not for both.

Does using of GlobalFit provide an additional information in contrast to normal fitting where I can use for second function the results of coefficient which is the same in both function?

Thanks,
Dejan
sls_dls_verJan12.pxp
OK- I still don't understand the problem you are solving, but maybe I don't need to.

Having looked at your experiment, I finally understand what you are doing, and I can say that Global Fit doesn't support exactly what you are doing. My guess is that the fit is good, but the fit curves are not what you expect.

Since Global Fit doesn't expect you to include the same Y wave twice in the list (I'm surprised I didn't put in code to check for that "mistake") a single fit_ curve wave is generated. I would have to check the code, but it's entirely likely that it is generated and filled twice- once for each inclusion in the wave list.

The work-around would be to duplicate each of your Y waves, and select the copy for the second inclusion in the list (and for the fit to the second fit function).

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com