当前位置:网站首页>样本方差为什么除以(n-1)
样本方差为什么除以(n-1)
2022-06-21 22:54:00 【subtitle_】
引言
学概率论和数理统计当时有个问题:样本方差为什么除以(n-1),当时学习的时候不是很理解,然而问老师老师也讲不出所以然(感觉老师好水呃…),于是自己找资料学习一下吧。整理如下。
1.前置知识
之前学过概率论和数理统计的小伙伴肯定也知道下面的公式:
1.如果均值(期望) E ( x ) = μ \mathbf{E}(x)=\mu E(x)=μ,方差 D ( x ) = σ 2 \mathbf{D}(x)=\sigma^2 D(x)=σ2,那么 E ( x ‾ ) = μ \mathbf{E}(\overline{x})=\mu E(x)=μ, D ( x ‾ ) = σ 2 / n \mathbf{D}(\overline{x})=\sigma^2/n D(x)=σ2/n
2.注意总体方差 σ 2 \sigma^2 σ2和样本方差 S 2 S^2 S2的公式是不一样的,首先分母一个是除以n,一个是除以(n-1),其次平方和内部一个减去的是总体均值 μ \mu μ,一个减去的是样本均值 x ‾ \overline{x} x,也即。
σ 2 = ∑ i = 1 n ( x i − μ ) 2 n , S 2 = ∑ i = 1 n ( x i − x ‾ ) 2 n − 1 \sigma^2=\frac{\sum_{i=1}^{n}(x_i-\mu)^2}{n},S^2=\frac{\sum_{i=1}^{n}(x_i-\overline{x})^2}{n-1} σ2=n∑i=1n(xi−μ)2,S2=n−1∑i=1n(xi−x)2
3. ∑ 1 = 1 k ( x i − x ‾ ) = 0 \sum_{1=1}^k(x_i-\overline{x})=0 ∑1=1k(xi−x)=0
2.证明思路
其实样本方差 S 2 S^2 S2本质上是总体均值 μ \mu μ或总体方差 σ 2 \sigma^2 σ2的一个点估计,是一个随机变量,而良好的点估计有两点最重要的性质:
(1)点估计是无偏的,点估计的期望值应该是被估计的参数,但仅满足这一点不够,因为点估计的形式可能有很多,所以还有第2条。
(2)无偏估计量有最小方差,最小方差点估计的方差比参数的任何一个其他估计量的方差都小。
下面证明 S 2 S^2 S2是 σ 2 \sigma^2 σ2的无偏估计量。即证明点估计的期望值应该是被估计的总体参数。
3.证明过程
总结了一下有下面的两种证明方法:其中第一种是书上常见给出的,第二种更好进行理解。
证明方法1: E ( S 2 ) = E ( ∑ i = 1 n ( x i − x ‾ ) 2 n − 1 ) = 1 n − 1 E [ ∑ i = 1 n ( x i − x ‾ ) 2 ] = 1 n − 1 E [ ∑ i = 1 n x i 2 − n x ‾ 2 ] = 1 n − 1 [ ∑ i = 1 n ( μ 2 + σ 2 ) − n ( μ 2 + σ 2 n ) ] = 1 n − 1 ( n − 1 ) σ 2 = σ 2 \begin{aligned}\mathbf{E}({S^2})&=\mathbf{E}(\frac{\sum_{i=1}^{n}(x_i-\overline{x})^2}{n-1})\\&=\frac{1}{n-1}\mathbf{E}[\sum_{i=1}^{n}(x_i-\overline{x})^2]\\&=\frac{1}{n-1}\mathbf{E}[\sum_{i=1}^{n}x_i^2-n\overline{x}^2]\\&=\frac{1}{n-1}[\sum_{i=1}^n(\mu^2+\sigma^2)-n(\mu^2+\frac{\sigma^2}{n})]\\&=\frac{1}{n-1}(n-1)\sigma^2\\&=\sigma^2\end{aligned} E(S2)=E(n−1∑i=1n(xi−x)2)=n−11E[i=1∑n(xi−x)2]=n−11E[i=1∑nxi2−nx2]=n−11[i=1∑n(μ2+σ2)−n(μ2+nσ2)]=n−11(n−1)σ2=σ2
证明方法2:
假设 t t t是一个常数: ∑ i = 1 n ( x i − t ) 2 = ∑ i = 1 n ( x i − x ‾ + x ‾ − t ) 2 = ∑ i = 1 n ( x i − x ‾ ) 2 + 2 ∑ i = 1 n ( x i − x ‾ ) ( x ‾ − t ) + ∑ i = 1 n ( x ‾ − t ) 2 = ∑ i = 1 n ( x i − x ‾ ) 2 + 2 ( x ‾ − t ) ∑ i = 1 n ( x i − x ‾ ) + ∑ i = 1 n ( x ‾ − t ) 2 = ∑ i = 1 n ( x i − x ‾ ) 2 + ∑ i = 1 n ( x ‾ − t ) 2 = ∑ i = 1 n ( x i − x ‾ ) 2 + n ( x ‾ − t ) 2 \begin{aligned}\sum_{i=1}^{n}(x_i-t)^2&=\sum_{i=1}^{n}(x_i-\overline{x}+\overline{x}-t)^2\\&=\sum_{i=1}^{n}(x_i-\overline{x})^2+2\sum_{i=1}^{n}(x_i-\overline{x})(\overline{x}-t)+\sum_{i=1}^{n}(\overline{x}-t)^2\\&=\sum_{i=1}^{n}(x_i-\overline{x})^2+2(\overline{x}-t)\sum_{i=1}^{n}(x_i-\overline{x})+\sum_{i=1}^{n}(\overline{x}-t)^2\\&=\sum_{i=1}^{n}(x_i-\overline{x})^2+\sum_{i=1}^{n}(\overline{x}-t)^2\\&=\sum_{i=1}^{n}(x_i-\overline{x})^2+n(\overline{x}-t)^2\end{aligned} i=1∑n(xi−t)2=i=1∑n(xi−x+x−t)2=i=1∑n(xi−x)2+2i=1∑n(xi−x)(x−t)+i=1∑n(x−t)2=i=1∑n(xi−x)2+2(x−t)i=1∑n(xi−x)+i=1∑n(x−t)2=i=1∑n(xi−x)2+i=1∑n(x−t)2=i=1∑n(xi−x)2+n(x−t)2
令式中的 t t t为总体均值 μ \mu μ,则有 ∑ i = 1 n ( x i − x ‾ ) 2 = ∑ i = 1 n ( x ‾ − μ ) 2 − n ( x ‾ − μ ) 2 \begin{aligned}\sum_{i=1}^{n}(x_i-\overline{x})^2=\sum_{i=1}^{n}(\overline{x}-\mu)^2-n(\overline{x}-\mu)^2\end{aligned} i=1∑n(xi−x)2=i=1∑n(x−μ)2−n(x−μ)2
可以看到 ∑ i = 1 n ( x i − x ‾ ) 2 \sum_{i=1}^{n}(x_i-\overline{x})^2 ∑i=1n(xi−x)2和 ∑ i = 1 n ( x ‾ − μ ) 2 \sum_{i=1}^{n}(\overline{x}-\mu)^2 ∑i=1n(x−μ)2之间不是严格相等的,还相差一个 n ( x ‾ − μ ) 2 n(\overline{x}-\mu)^2 n(x−μ)2。则 E ( S 2 ) = E ( ∑ i = 1 n ( x i − x ‾ ) 2 n − 1 ) = 1 n − 1 E [ ∑ i = 1 n ( x i − x ‾ ) 2 ] = 1 n − 1 E [ ∑ i = 1 n ( ( x ‾ − μ ) 2 − n ( x ‾ − μ ) 2 ) ] = 1 n − 1 [ E ( ∑ i = 1 n ( x ‾ − μ ) 2 ) − E ( ∑ i = 1 n n ( x ‾ − μ ) 2 ) ] = 1 n − 1 [ E ( ∑ i = 1 n ( x ‾ − μ ) 2 ) − n E ( ∑ i = 1 n ( x ‾ − μ ) 2 ) ] = 1 n − 1 ( n σ 2 − n ⋅ σ 2 n ) = σ 2 \begin{aligned}\mathbf{E}({S^2})&=\mathbf{E}(\frac{\sum_{i=1}^{n}(x_i-\overline{x})^2}{n-1})\\&=\frac{1}{n-1}\mathbf{E}[\sum_{i=1}^{n}(x_i-\overline{x})^2]\\&=\frac{1}{n-1}\mathbf{E}[\sum_{i=1}^{n}(\left(\overline{x}-\mu)^2-n(\overline{x}-\mu)^2\right)]\\&=\frac{1}{n-1}[\mathbf{E}\left(\sum_{i=1}^{n}(\overline{x}-\mu)^2\right)-\mathbf{E}\left(\sum_{i=1}^{n}n(\overline{x}-\mu)^2\right)]\\&=\frac{1}{n-1}[\mathbf{E}\left(\sum_{i=1}^{n}(\overline{x}-\mu)^2\right)-n\mathbf{E}\left(\sum_{i=1}^{n}(\overline{x}-\mu)^2\right)]\\&=\frac{1}{n-1}(n\sigma^2-n\cdot\frac{\sigma^2}{n})\\&=\sigma^2\end{aligned} E(S2)=E(n−1∑i=1n(xi−x)2)=n−11E[i=1∑n(xi−x)2]=n−11E[i=1∑n((x−μ)2−n(x−μ)2)]=n−11[E(i=1∑n(x−μ)2)−E(i=1∑nn(x−μ)2)]=n−11[E(i=1∑n(x−μ)2)−nE(i=1∑n(x−μ)2)]=n−11(nσ2−n⋅nσ2)=σ2
两种证明方法都可以帮助理解。希望能对大家有帮助。
边栏推荐
- 干技术的,追求啥?
- 【next】nextjs打包后出现passHref is missing
- Detailed explanation of IDA static reverse analysis tool
- qt QMediaPlayer获取音频播放结束状态
- [wechat applet] some pitfalls and precautions of wechat applet using the form
- 数据库每日一题---第19天:排名靠前的旅行者
- Meet webassembly again
- Npdp| how to do well in product life cycle management?
- [安洵杯 2019]吹着贝斯扫二维码
- 【Try to Hack】nmap
猜你喜欢

American tourist visa interview instructions, let me focus!

7. target detection

MySQL性能分析工具的使用

Meet webassembly again

【微信小程序】40029 invalid code解决办法集合

WMS warehouse management system source code
![[next] the component definition is missing display name in the next JS package](/img/19/2da1ea19987959f8636aa1dbbaae26.png)
[next] the component definition is missing display name in the next JS package

We sincerely invite elastic stack developers to become CSDN elastic cloud community administrators

Lectures explanation for unsupervised graph level representation learning (usib)

How does the system integration project management engineer (soft exam intermediate) prepare for the exam?
随机推荐
数据魔术师告诉你整数规划COPT5.0离CPLEX还有多远?
如何使用tensorboard add_histogram
MySQL性能分析工具的使用
rabbit:do_run_postlaunch_phase/0 line 932
【yarn】Name contains illegal characters
Brève idée et cas simple de l'ajustement JVM - mécanisme de garantie de l'allocation de l'espace dans les temps anciens
Meet webassembly again
一文看尽物体检测中的各种FPN
AttributeError: ‘WebDriver‘ object has no attribute ‘w3c‘
How to gracefully count code time
[安洵杯 2019]吹着贝斯扫二维码
How does the system integration project management engineer (soft exam intermediate) prepare for the exam?
Arm32 instruction parsing general register
pytorch可视化
Xshell can only input the public key solution [personal test] when connecting to the virtual machine
All kinds of FPN in object detection
[wechat applet] some pitfalls and precautions of wechat applet using the form
buuctf misc 间谍启示录
[GXYCTF2019]SXMgdGhpcyBiYXNlPw==
Pseudo instruction in arm assembly