07-05-2012 07:01 AM
Hi,
Using LabView and Curvefitting. Following situation:
I have 15points including their standard deviation. I also have set up my curvefitting with my individual gaussian fitting. Basically the fitting looks good.
But how can i tell labview to take care about my already calculated standard deviation.
I always compare it with my OriginPro fitting (same gaussian equation). If I only take my data X and Y I get the same results.
But when I also indicate my standard deviation (in Origin), meaning X, Y and +-Y I get a more realistic result.
And that is what I would like to do with LabView aswell but there is no possibility to take my +-Y in account, isn't it?
(And no, the Origin VIs for LabView do not offer me this aswell. At least I don't see it ;))
Anyone a hint?
Thanks in advance
Solved! Go to Solution.
07-05-2012 07:53 AM - edited 07-05-2012 08:00 AM
That's what the weighting array is for 🙂
Just use the reciprocal of the variances
Understanding of the math is helpful , reading the help of the fitting vi is the first step 😉
Oh, the fitting vis of LabVIEW have a weighting input :0
07-05-2012 09:37 AM
uhh.
Okay. That's not working with the CurveFitting SubVi but with normal Non-Linear Curve fitting.
Anyway:THANKS
But now I have the problem that these new results are still totally different to the Origin ones.
I try to figure it out.
07-05-2012 11:11 AM
benodin wrote:Okay. That's not working with the CurveFitting SubVi but with normal Non-Linear Curve fitting.
But now I have the problem that these new results are still totally different to the Origin ones.
What is the "CurveFitting SubVi"?
In what way is the result different? How much is "totally"?
Show us your code with some typical data and tell us what result you expect.
07-05-2012 11:40 AM
@altenbach wrote:
What is the "CurveFitting SubVi"?
sorry, meaning CurveFitting Express.vi
I have an equation like: a+b*10^(-c*(x-x0)^2)
a, b are offsets. x0 is the center of my gaussian curve. and i'm interested in c which describes the width of the gaussian function.
please have a look to the attached file:
- the red dots are mmy data plus the standard deviation (white dots)
- the green fitting curve is labview using the CurveFittingExpress
- the yellow fitting curve is using LabView Non-Linear Fitting with weigthing
- the blue fitting curve is the output I get using OriginPro. As you could see Origin is the only one taking care about the points at the edge (fitting inside the standard deviation)
that means in terms of c:
labview: 0.089
origin: 0.053
x0 is kinda similar. a,b, are different.
that's it.
07-05-2012 12:40 PM - edited 07-05-2012 12:45 PM
How hard would it be for you to attach some actual data? We cannot tell what's going on from a picture of the results.
@benodin wrote:
@altenbach wrote:
As you could see Origin is the only one taking care about the points at the edge (fitting inside the standard deviation)
How do you know that Origin is correct? Statistically, about 30% should be outside the +/- standard deviation, so if all results fall within, something is very suspicious. Either your SDs are not realistic or something else is wrong.
07-06-2012 04:16 AM
Hi,
I'm not saying that Origin is right or LabView is wrong. And maybe my SDs are not realistic (or wrong) but let's assume they are right 😉
But I tend to say that the Origin Fitting looks more reasonable and also R-Square is slightly better.
However, every help and hint is aprreciated, maybe I'm just doing it totally wrong.
The point is I would like to get in both programs the same results.
Please see attached my (cleaned up) version.
Thanks.
07-06-2012 05:51 AM
Good that you provide data 🙂
here is a corrected version. the weight is 1/stdev !!!
And I added the gaußian fit 😉
07-06-2012 06:08 AM
Hi, thanks
BUT
you have a newer LV version than mine. I have 2009 9.0f3. I'm not able to open your file.
Could you please upload it again as an older version. THANKS
07-06-2012 06:23 AM
here we go