LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Curve fitting: Taking standard deviation into account

Solved!
Go to solution

thanks...

especially for the weighting (ups Smiley Surprised)

 

(this particular gaussian fit is usless for me because I need mine. Even it looks very good :))



0 Kudos
Message 11 of 17
(838 Views)

The weight is 1/variance, so you need to square the sdtdev. i.e. weight=(1/sd)² . (see also). Now the origin and nonlinear fit are very similar, see attached.

 

I don't understand why you have a big sequence structure. There is no problem with execution order.

 


Also most of your code is extremely convoluted. As an example, let's have a look at how you generate the origin data (see picture)

 

A simple autoindexing FOR loop is all that's needed (middle). You could even use an expression node, pasting the formula "as is". (I don't like that express VI at all, because you never know what it's doing unless you open the panel.)

Download All
Message 12 of 17
(804 Views)

Here's a "slightly" cleaned-up version. Modify as needed.

 

LabVIEW is parallel. Don't chop up the code with sequence structures. I would also use complex for xy graphs, simpler data structures. 😄

 

Download All
Message 13 of 17
(791 Views)

Unbelievable, thanks a lot.

I appreciate that.

And many thanks for the weighting issue as well!

 

(The sequence structure was only to show what I'm doing in a clear way)

0 Kudos
Message 14 of 17
(781 Views)

Ha, but I found an other question.Smiley Indifferent

 

Now I get values for a,b,c,d. How do I get the standard deviation of them?

THANKS

0 Kudos
Message 15 of 17
(775 Views)

@benodin wrote:

Now I get values for a,b,c,d. How do I get the standard deviation of them?


You can get it from the covariance matrix. Start with this thread.

Message 16 of 17
(769 Views)

as far as I understand:

 

take each value of the diagonal -> take the square root and multiply with the RMSE-> std of the coefficients

 

at least the results look very reasonable

0 Kudos
Message 17 of 17
(750 Views)