English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

i require a c program to calculate the variance for set of 24000 values.

2007-01-26 00:53:03 · 1 answers · asked by ? 1 in Science & Mathematics Engineering

1 answers

Wikipedia is your Friend !

Compute the mean;
subtract the mean from each number (the outcomes are called "deviations");
square the deviations;
take the mean of these squares.

OR

n = 0
mean = 0
S = 0

foreach x in data:
n = n + 1
delta = x - mean
mean = mean + delta/n
S = S + delta*(x - mean)
end for

variance = S/(n - 1)

2007-01-29 17:38:52 · answer #1 · answered by Alan 6 · 0 0

fedest.com, questions and answers