Author |
Topic |
|
belisagalan
3 Posts |
Posted - 11/20/2010 : 3:37:10 PM
|
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
|
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 |
|
|
belisagalan
3 Posts |
Posted - 11/22/2010 : 1:49:54 PM
|
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! |
|
|
easwar
USA
1964 Posts |
Posted - 11/22/2010 : 2:40:35 PM
|
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 |
|
|
belisagalan
3 Posts |
Posted - 11/23/2010 : 05:32:49 AM
|
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! |
|
|
easwar
USA
1964 Posts |
Posted - 11/23/2010 : 10:41:20 AM
|
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 |
|
|
|
Topic |
|
|
|