0
$\begingroup$

if I have a sample composed by values lesser than 1 and i want to compute the sample variance with $ \frac{n}{n-1}(\langle x_i^2 \rangle - \langle x_i \rangle^2)$ how can i do? Because the mean of the square is lesser than the square of the mean so the result is negative.. All is good if I use $ \frac{1}{n-1}\sum((x_i - x_{mean})^2)$...

$\endgroup$
  • 1
    $\begingroup$ You don't, because your formula is wrong. Double-check the parentheses. $\endgroup$ – whuber May 15 '15 at 18:27
  • $\begingroup$ Is it the first equation wrong? (I have delete the sum in front of it) $\endgroup$ – Andrea Oliveri May 15 '15 at 18:58
  • $\begingroup$ Now the formula makes no sense because the summation is gone but the bound subscript "$i$" remains. The angle brackets (presumably denoting expectations?) do not apply to a sample in any event. See stats.stackexchange.com/questions/146735, for instance. $\endgroup$ – whuber May 15 '15 at 19:37
  • $\begingroup$ Ok so if i remove the subscript "i" and read angle brackets as expectation does the first equation equal to the second? (it's simply the expansion of the square of the second equation). But if are they equal why the first returns a negative number (for data lesser than 1)? $\endgroup$ – Andrea Oliveri May 16 '15 at 12:19
  • $\begingroup$ The use of angle brackets as "expectation" is inconsistent with the intended meaning of a sample moment. If you're getting a negative value, then you are not computing according to a correct formula. $\endgroup$ – whuber May 16 '15 at 19:38
1
$\begingroup$

The correct formulas are given on the Wikipedia Variance page, under the heading "Sample variance." If you are finding that the mean of the squares is less than the square of the mean, double-check for a problem with how you have set up your calculations.

| cite | improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.