無偏估計與自由度

不記得當初是怎麼學概率論和數理統計的了。最近總是遇到一個小問題,想不通爲什麼樣本方差的無偏估計量是要除以N-1的。

上Wiki找了一下,

Estimating variance

Suppose X1, ..., Xn are independent and identically distributed random variables with expectation μ and variance σ? Let

\overline{X}=(X_1+\cdots+X_n)/n

be the "sample average", and let

S^2=\frac{1}{n}\sum_{i=1}^n(X_i-\overline{X}\,)^2

be a "sample variance". Then S?is a "biased estimator" of σ?because

\operatorname{E}(S^2)=\frac{n-1}{n}\sigma^2\neq\sigma^2.

Note that when a transformation is applied to an unbiased estimator, the result is not necessarily itself an unbiased estimate of its corresponding population statistic. That is, for a non-linear function f and an unbiased estimator U of a parameter pf(U) is usually not an unbiased estimator off(p). For example the square root of the unbiased estimator of the populationvariance is not an unbiased estimator of the population standard deviation.

Bias is not the only consideration when choosing a statistic, however. Bias refers to the central tendency of the sampling distribution of a statistic, but the variance of the sampling distribution can also be an important consideration. Specifically, statistics with smaller sampling variances will yield greater statistical power. For example, while S?above is more biased than the traditional sample calculation

S_\mathrm{sample}^2=\frac{1}{n-1}\sum_{i=1}^n(X_i-\overline{X}\,)^2,

S?has a lower estimation variability than S?sub>sample because the denominator dividing the sum of squares is larger in the calculation of S? resulting in a smaller scale of final values, and therefore lower estimation variability, than that of S?sub>sample. Practically, this demonstrates that for some applications (where the amount of bias can be equated between groups/conditions) it is possible that a biased estimator can prove to be a more powerful, and therefore useful, statistic.

自由度(degree of freedom, df)是指當以樣本的統計量來估計總體的參數時,樣本中獨立或能自由變化的數據的個數稱爲該統計量的自由度。

例如,在估計總體的平均數時,樣本中的n個數全部加起來,其中任何一個數都和其他數據相獨立,從其中抽出任何一個數都不影響其他數據(這也是隨機抽樣所要求的)。因此一組數據中每一個數據都是獨立的,所以自由度就是估計總體參數時獨立數據的數目,而平均數是根據n個獨立數據來估計的,因此自由度爲n。

但是爲什麼用樣本估計總體的方差時,方差的自由度就是(n-1)?

s2= å(X-m)2/n

從此公式我們可以看出總體的方差是由各數據與總體平均數的差值求出來的,因此必須將m固定後纔可以求總體的方差。因此,由於m被固定,它就不能獨立自由變化,也就是方差受到總體平均數的限制,少了一個自由變化的機會,因此要從n裏減掉一個。

假設一個樣本有兩個數值,X1=10,X2=20,我們現在要用這個樣本估計總體的方差,則樣本的平均數是:

Xm=å X/n=(10+20)/2=15

現在假設我們已知Xm=15,X1=10,根據公式Xm=å X/n,則有:

X2=2Xm-X1=2×15-10=20

由此我們可以知道在有兩個數據樣本中,當平均數的值和其中一個數據的值已知時,另一個數據的值就不能自由變化了,因此這個樣本的自由度就減少一個,變成了(n-1)。依此類推:在一組數據中,當其平均數和前面的數據都已知時,最後一個數據就被固定而不能獨立變化了,因此這個樣本能夠獨立自由變化的數目就是(n-1)個.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章