LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How could i compute accurately standard deviation

I wanted to compute standard deviation usind cvi SPC Toolkit.
The problem is that there are several functions able to compute standard deviation, but from different formula.
The only one which seem compute standard deviation the with the suitable formula, for my project, is :SPCSampleStatistics.
But this function compute in the same time other values as skewness or kurtosis what brake the program.
Then I look for a function which compute only standard deviation by the good way.
ps:I have already tried withou succes StdDev, and a function made by myself.
thank you for your answers.
best regard
0 Kudos
Message 1 of 2
(3,031 Views)
You should definitely be using either SPCSampleStatistics from the SPC Toolkit or StdDev from the Advanced Analysis Library.

I'm not sure what you mean when you say that you cannot use SPCSampleStatistics because of the extra parameters you do not need "breaks" your program, but what might be possible is that you did not declare any variables for skewness or kurtosis to pass into the function by reference, which would cause a compilation error. Even if you don't need these values it will not hurt for you to just declare the variables and pass their addresses to the function. If you call this function properly as I am describing then you should not see any problems.

Also I am not sure what you mean when you say that the StdDev function is not successful. This function
works almost identically to SPCSampleStatistics in terms of creating variables and passing their addresses to the function. Again, just make sure that you are calling the function properly.

As a last resort solution, you should be also able to create a function on your own that calculates the standard deviation with just simple mathematical operators, albeit that this can get quite complex if you expect to handle all situations properly. This is why we created the two functions mentioned above, because we have already done this for you.

Again, just make sure that you are properly calling the functions and passing in all of the parameters correctly by reference or by value and you should be alright.

Jason F.
Applications Engineer
National Instruments
www.ni.com/ask
0 Kudos
Message 2 of 2
(3,031 Views)