当前位置:网站首页>Why is the sample variance divided by (n-1)
Why is the sample variance divided by (n-1)
2022-06-22 00:34:00 【subtitle_】
introduction
There was a problem in probability theory and mathematical statistics : Why is the sample variance divided by (n-1), At that time, I didn't understand very well when I was studying , However, if you ask the teacher, the teacher can't tell why ( I feel that the teacher is good at water …), So find your own materials to learn . It is arranged as follows .
1. Pre knowledge
The little friend who has studied probability theory and mathematical statistics must also know the following formula :
1. If the mean ( expect ) E ( x ) = μ \mathbf{E}(x)=\mu E(x)=μ, variance D ( x ) = σ 2 \mathbf{D}(x)=\sigma^2 D(x)=σ2, that 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. Note the population variance σ 2 \sigma^2 σ2 And sample variance S 2 S^2 S2 The formula is different , The first denominator is divided by n, One is divided by (n-1), Second, the sum of squares minus the inner one is the overall mean μ \mu μ, One subtracts the sample mean x ‾ \overline{x} x, That is to say .
σ 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. Proving ideas
Actually, the sample variance S 2 S^2 S2 It is essentially the overall mean μ \mu μ Or total variance σ 2 \sigma^2 σ2 A point estimation of , It's a random variable , Good point estimation has two most important properties :
(1) The point estimate is unbiased , The expected value of the point estimate should be the estimated parameter , But this is not enough , Because there may be many forms of point estimation , So there's a third 2 strip .
(2) The unbiased estimator has a minimum variance , The variance of the minimum variance point estimate is smaller than that of any other estimator of the parameter .
The following proof S 2 S^2 S2 yes σ 2 \sigma^2 σ2 An unbiased estimator of . It is proved that the expected value of the point estimate should be the estimated population parameter .
3. Proof process
There are two ways to prove it : The first one is commonly given in books , The second is better understood .
Method of proof 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
Method of proof 2:
hypothesis t t t It's a constant : ∑ 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
In the order t t t Is the overall mean μ \mu μ, Then there are ∑ 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
You can see ∑ i = 1 n ( x i − x ‾ ) 2 \sum_{i=1}^{n}(x_i-\overline{x})^2 ∑i=1n(xi−x)2 and ∑ i = 1 n ( x ‾ − μ ) 2 \sum_{i=1}^{n}(\overline{x}-\mu)^2 ∑i=1n(x−μ)2 Are not strictly equal , There is still a difference n ( x ‾ − μ ) 2 n(\overline{x}-\mu)^2 n(x−μ)2. be 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
Both methods of proof can help understand . I hope it can help you .
边栏推荐
- HMS core machine learning service ID card identification function to achieve efficient information entry
- Copy and paste in terminal, 0~ and 1~ characters are added
- Infant name [adjacency matrix and DFS of connected components]
- How to gracefully count code time
- 客户端建设及调优实践
- buuctf misc 弱口令
- 【微信小程序】微信小程序使用表单的一些坑和注意事项
- Root detection implementation
- All kinds of FPN in object detection
- JVM調優簡要思想及簡單案例-老年代空間分配擔保機制
猜你喜欢

Getting started with go web programming: validators

buuctf pwn ciscn_2019_n_8

Client construction and Optimization Practice

Qt之自制MP3播放器

im即时通讯源码+软件+app附详细封装视频搭建教程

MNIST image classification and comparison based on K-nearest neighbor

QT self made MP3 player

The difference between overloading and overriding
![[actf freshman competition 2020]swp](/img/80/9fe85ee614857c5800c0d0b1ba9a3d.png)
[actf freshman competition 2020]swp

关于 NFT 和版权的纠结真相
随机推荐
Copy and paste in terminal, 0~ and 1~ characters are added
[安洵杯 2019]吹着贝斯扫二维码
关于相机位姿的可视化
数学知识:约数个数—约数
【2023提前批 之 面经】~ 青岛鼎信科技
buuctf pwn ciscn_2019_n_8
【php】mvcs概念(通俗易懂)
leetcode 279. Perfect Squares 完全平方数(中等)
MNIST image classification and comparison based on K-nearest neighbor
【yarn】Name contains illegal characters
关于一次Web线下面试的思考
Detailed explanation of IDA static reverse analysis tool
arm汇编DCB、DCW、DCD、DCQ解析
Mathematical knowledge: greatest common divisor divisor
诚邀 Elastic Stack 开发者成为 CSDN Elastic 云社区管理员
[typescript] the difference between exclamation mark and question mark in typescript
Win10使用用户初始密码,连接Win Server失败
note
[pwn basics]pwntools learning
buuctf misc 弱口令