LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Standard Deviation Calculation in CVI

Hi.

Using the "StdDev" function within the Advanced
Analysis Library, I am getting a value which appears to differ a fair amount from the STDEV function found in MS-Excel. I guess the algorithms that are being used may be different, but is there a way to see what type of formula algorithm the CVI version is using?

For example, CVI says the STND DEV for
{1, 2, 6, 8, 1} is 2.87054 while Excel says 3.2094. Of course they both agree more closely as the data points have smaller, and smaller variance.

Any ideas?


BTW, I'm using CVI v5.0
0 Kudos
Message 1 of 3
(4,531 Views)
According to the on-line documentation, the formulas used are:

CVI:
sDEV = Sqrt{Sum(for i=0 to n-1) [x(i)-mean]**2/n]}

(Right click in the function panel window, NON on the parameters of the function, OR right click on any parameter and then select Function help... in the help window)

EXCEL:
sDev = Sqrt{[n*Sum(x**2) - [Sum(x)]**2] / [n*(n-1)]}

As you see the two algorithm are very different.
I'm sorry I can't help you with more detail: I'm not a statistic expert, so I can't discuss if they are equivalent (seems they're not) or which of them is the right one (if a 'right' one exists!).

Hope it helps
Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 3
(4,531 Views)
CVI's StdDev function calculates the population standard deviation and is equivalent to Excel's STDEVP function. These functions should be used when your data set represents the entire population.

Excel's STDEV function calculates the sample standard deviation. It should be used when your data set represents only a sample of the entire population. There is no equivalent function in CVI, although you can implement the formula directly.
0 Kudos
Message 3 of 3
(4,531 Views)