Sample variance and standard deviation

The sample variance of given numbers x_1, \cdots, x_n, is defined as

\sigma^2 := \frac{1}{n} ((x_1 -\hat{x})^2 + \cdots + (x_n - \hat{x})^2),

where \hat{x} is the sample average of x_1, \cdots, x_n. The sample variance is a measure of the deviations of the numbers x_i with respect to the average value \hat{x}.

The sample standard deviation is the square root of the sample variance, \sigma^2. It can be expressed in terms of the Euclidean norm of the vector x = (x_1, \cdots, x_n) , as

\sigma = \frac{1}{\sqrt{n}}||x-\hat{x}{\bf 1}||_2,

where ||\cdot||_2 denotes the Euclidean norm.

More generally, for any vector p \in \mathbb{R}^n, with p_i \ge 0 for every i, and p_1 + \cdots + p_n = 1, we can define the corresponding weighted variance as

\sum\limits_{i=1}^n p_i(x_i - \hat{x})^2.

The interpretation of p is in terms of a discrete probability distribution of a random variable X, which takes the value x_i with probability p_i, i = 1, \cdots, n. The weighted variance is then simply the expected value of the squared deviation of X from its mean {\bf E}(X), under the probability distribution p.

See also: sample and weighted average.

License

Hyper-Textbook: Optimization Models and Applications Copyright © by L. El Ghaoui. All Rights Reserved.

Share This Book