✔ 最佳答案
為甚麼s.d要用n-1計。因為用n-1的那個是無偏的。但個proof 好長。不過都找到啦。看不明可以電郵我
Expected Value of S2
The following is a proof that the formula for the sample variance, S2, is unbiased. Recall that it seemed like we should divide by n, but instead we divide by n-1. Here's why.
First, recall the formula for the sample variance:
圖片參考:
http://www.spelman.edu/~anderson/teaching/437/unbiased/img14.gif
Now, we want to compute the expected value of this:
圖片參考:
http://www.spelman.edu/~anderson/teaching/437/unbiased/img15.gif
Now, let's multiply both sides of the equation by n-1, just so we don't have to keep carrying that around, and square out the right side, just like we did with that shortcut formula for SSX, above.
圖片參考:
http://www.spelman.edu/~anderson/teaching/437/unbiased/img16.gif
Now, if you think about it, it's clear that
圖片參考:
http://www.spelman.edu/~anderson/teaching/437/unbiased/img1.gif
:
圖片參考:
http://www.spelman.edu/~anderson/teaching/437/unbiased/img18.gif
Let's write that again as a numbered equation:
圖片參考:
http://www.spelman.edu/~anderson/teaching/437/unbiased/img19.gif
(1)
Unfortunately, the expected value of the square of something is not equal to the square of the expected value, so we seem to have hit an impasse with both terms on the RHS. But, we're not out of tricks yet. Each of those terms is an expected value of something squared: a second moment. Let's use the trick about moments that we saw above.
First, let Y be the random variable defined by the sample mean,
圖片參考:
http://www.spelman.edu/~anderson/teaching/437/unbiased/img1.gif
. We're trying to figure out the expected value of its square.
圖片參考:
http://www.spelman.edu/~anderson/teaching/437/unbiased/img20.gif
We can substitute this stuff for the second term on the RHS of equation 1. Also, note that the first term on the RHS of eqation 1 is the second moment of X, so that can also be re-written. Doing both substitutions gives us:
圖片參考:
http://www.spelman.edu/~anderson/teaching/437/unbiased/img21.gif
Whew! That was hard, but solvable. This is why S2 with the n-1 denominator is an unbiased estimator.