LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Curve fitting: Taking standard deviation into account

Solved!
Go to solution

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

0 Kudos
Message 1 of 17
(4,660 Views)
Solution
Accepted by topic author benodin

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

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 2 of 17
(4,651 Views)

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.

0 Kudos
Message 3 of 17
(4,638 Views)

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.

 

Message 4 of 17
(4,629 Views)

@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.

 

0 Kudos
Message 5 of 17
(4,625 Views)

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.

Message 6 of 17
(4,612 Views)

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.

0 Kudos
Message 7 of 17
(4,580 Views)

Good that you provide data 🙂

 

here is a corrected version. the weight is 1/stdev !!!

 

And I added the gaußian fit  😉

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 8 of 17
(4,580 Views)

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

0 Kudos
Message 9 of 17
(4,577 Views)

here we go

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 10 of 17
(4,573 Views)