The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Non linear curve fitting weights
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

belisagalan

3 Posts

Posted - 11/20/2010 :  3:37:10 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi, i'm trying to fit some data to the allometric function. Some of my data have error bars but others don't. When I do the fitting with instrumental weight, as some errors are zero, it does not work because w=1/sigma is infinte and chi-2 can't be calculated.
How should I do that? The only option i see is to forget about instrumental weight and do it with statistical weight or without weight, but I want to take into account the errors in some of the data...
Thank you very much!

easwar

USA
1964 Posts

Posted - 11/22/2010 :  12:16:08 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Yes, if the error is zero, then the instrumental weight would not proceed as that value is not allowed because of the 1/zero or 1/very-small-number.

The only way to override that is for you to set a different value, such as setting it to a small number (say for example 0.1, to indicate the error is almost negligible on that point, if other error values are much larger). So what you pick as number to replace is sensitive to your data.

Easwar
OriginLab
Go to Top of Page

belisagalan

3 Posts

Posted - 11/22/2010 :  1:49:54 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you for your answer! I'll try it.

I have another doubt about the fitting.
When I fit my data to the allometric function y=a*x^b (fixing the exponent b to 0,5) gives very low R2. But if I calculate the square root of my x data and then do the fitting with a linear function y=a*z+b (in this case z=sqrt(x))(with b=0), which is actually the same function, I obtained very high R2 values.
Does it make sense? Am I doing something wrong?
I suppose it is related to the differences between linear and non linear fitting, but why is the linear fitting 'better'?

Thank you very much for your help!
Go to Top of Page

easwar

USA
1964 Posts

Posted - 11/22/2010 :  2:40:35 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

This could be dependent on data...I tried with some sample data and got almost exactly same r^2 by both methods. Perhaps send your data to tech support so we can look at your particular data? If you send, please refer to this post.

Here's how to send the data:
http://originlab.com/index.aspx?go=Support&pid=752

Easwar
OriginLab
Go to Top of Page

belisagalan

3 Posts

Posted - 11/23/2010 :  05:32:49 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Here is a very easy example with 3 (x,y) points (0;0), (1;2), (4;2.8).
The allometric fitting y=a*x^b(with b=0,5) gives R2=0.1.
The square of x data leaves the two first points the same and the third one changes to: (2;2.8).
The linear fitting y=a*x+b (with b=0) of these new data gives R2=0.97568.
...?
thank you very much for your help!
Go to Top of Page

easwar

USA
1964 Posts

Posted - 11/23/2010 :  10:41:20 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

With your data, if you look at the NLfit result, for some reason it reports only 2 data points. It looks like it is ignoring the 0,0 point for some reason in this particular function. We will look into why this is happening. For now if replace the 0 with some very small number such as 1E-10 then it works correctly and you get an R^2 value much closer to 1.

Thanks for finding this issue!

Easwar
OriginLab
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000