# 标准差

（重定向自均方差

1. 为非负数值（因为开平方后再做平方根）；
2. 与测量资料具有相同单位（这样才能比对）。

## 母体的标准差

### 基本定义

${\displaystyle \ SD={\sqrt {{\frac {1}{N}}\sum _{i=1}^{N}(x_{i}-\mu )^{2}}}}$

${\displaystyle \mu }$为平均值（${\displaystyle {\overline {x}}}$）。

### 简化计算公式

{\displaystyle {\begin{aligned}\sum _{i=1}^{N}(X_{i}-\mu )^{2}&={}\sum _{i=1}^{N}(X_{i}^{2}-2X_{i}\mu +\mu ^{2})\\&{}=\left(\sum _{i=1}^{N}X_{i}^{2}\right)-\left(2\mu \sum _{i=1}^{N}X_{i}\right)+N\mu ^{2}\\&{}=\left(\sum _{i=1}^{N}X_{i}^{2}\right)-2\mu (N\mu )+N\mu ^{2}\\&{}=\left(\sum _{i=1}^{N}X_{i}^{2}\right)-2N\mu ^{2}+N\mu ^{2}\\&{}=\left(\sum _{i=1}^{N}X_{i}^{2}\right)-N\mu ^{2}\end{aligned}}}

${\displaystyle \sigma ={\sqrt {{\frac {1}{N}}\sum _{i=1}^{N}(X_{i}-\mu )^{2}}}}$
${\displaystyle ={\sqrt {{\frac {1}{N}}\left(\sum _{i=1}^{N}X_{i}^{2}\right)-{\frac {1}{N}}N\mu ^{2}}}}$
${\displaystyle ={\sqrt {{\frac {\sum _{i=1}^{N}X_{i}^{2}}{N}}-\mu ^{2}}}}$

### 母体为随机变量

${\displaystyle \sigma ={\sqrt {\operatorname {E} ((X-\operatorname {E} (X))^{2})}}={\sqrt {\operatorname {E} (X^{2})-(\operatorname {E} (X))^{2}}}}$

#### 离散随机变量的标准差

${\displaystyle X}$是由实数${\displaystyle x_{1},x_{2},...,x_{n}}$构成的离散随机变数英语：discrete random variable），且每个值的机率相等，则${\displaystyle X}$的标准差定义为：

${\displaystyle \sigma ={\sqrt {{\frac {1}{N}}\left[(x_{1}-\mu )^{2}+(x_{2}-\mu )^{2}+\cdots +(x_{N}-\mu )^{2}\right]}}}$　，其中　${\displaystyle \mu ={\frac {1}{N}}(x_{1}+\cdots +x_{N})}$

${\displaystyle \sigma ={\sqrt {{\frac {1}{N}}\sum _{i=1}^{N}(x_{i}-\mu )^{2}}}}$　，其中　${\displaystyle \mu ={\frac {1}{N}}(x_{1}+\cdots +x_{N})}$

${\displaystyle \sigma ={\sqrt {\sum _{i=1}^{N}p_{i}(x_{i}-\mu )^{2}}}}$　，其中　${\displaystyle \mu =\sum _{i=1}^{N}p_{i}x_{i}.}$

#### 连续随机变量的标准差

${\displaystyle X}$为概率密度${\displaystyle p(X)}$连续随机变量英语：continuous random variable），则${\displaystyle X}$的标准差定义为：

${\displaystyle \sigma ={\sqrt {\int (x-\mu )^{2}\,p(x)\,dx}}}$

${\displaystyle \mu =\int x\,p(x)\,dx}$

### 标准差的特殊性质

${\displaystyle \sigma (X+c)=\sigma (X)}$
${\displaystyle \sigma (cX)=c\cdot \sigma (X)}$
${\displaystyle \sigma (X+Y)={\sqrt {\sigma ^{2}(X)+\sigma ^{2}(Y)+2\cdot {\mbox{cov}}(X,Y)}}}$

• ${\displaystyle {\mbox{cov}}(X,Y)}$表示随机变量${\displaystyle X}$${\displaystyle Y}$协方差
• ${\displaystyle \sigma ^{2}(X)}$表示${\displaystyle [\sigma (X)]^{2}}$，即${\displaystyle Var(X)}$${\displaystyle X}$的变异数），对${\displaystyle Y}$亦同。

## 样本的标准差

${\displaystyle s={\sqrt {{\frac {1}{n-1}}\sum _{i=1}^{n}(x_{i}-{\bar {x}})^{2}}}}$

## 范例

• 第一步，计算平均值${\displaystyle {\overline {x}}}$
${\displaystyle {\overline {x}}={\frac {1}{N}}\sum _{i=1}^{N}x_{i}}$
${\displaystyle {\begin{smallmatrix}N=4\end{smallmatrix}}}$（因为集合里有4个数），分别设为：
{\displaystyle {\begin{aligned}x_{1}&=5\\x_{2}&=6\\x_{3}&=8\\x_{4}&=9\\\end{aligned}}}
${\displaystyle {\overline {x}}={\frac {1}{4}}\sum _{i=1}^{4}x_{i}}$${\displaystyle (N=4)}$
${\displaystyle {\overline {x}}={\frac {1}{4}}\left(x_{1}+x_{2}+x_{3}+x_{4}\right)}$
${\displaystyle {\overline {x}}={\frac {1}{4}}\left(5+6+8+9\right)}$
${\displaystyle {\overline {x}}=7}$（此为平均值）
• 第二步，计算标准差${\displaystyle \sigma \,}$
${\displaystyle \sigma ={\sqrt {{\frac {1}{N}}\sum _{i=1}^{N}(x_{i}-{\overline {x}})^{2}}}}$
${\displaystyle \sigma ={\sqrt {{\frac {1}{4}}\sum _{i=1}^{4}(x_{i}-{\overline {x}})^{2}}}}$${\displaystyle (N=4)}$
${\displaystyle \sigma ={\sqrt {{\frac {1}{4}}\sum _{i=1}^{4}(x_{i}-7)^{2}}}}$${\displaystyle ({\overline {x}}=7)}$
${\displaystyle \sigma ={\sqrt {{\frac {1}{4}}\left[(x_{1}-7)^{2}+(x_{2}-7)^{2}+(x_{3}-7)^{2}+(x_{4}-7)^{2}\right]}}}$
${\displaystyle \sigma ={\sqrt {{\frac {1}{4}}\left[(5-7)^{2}+(6-7)^{2}+(8-7)^{2}+(9-7)^{2}\right]}}}$
${\displaystyle \sigma ={\sqrt {{\frac {1}{4}}\left((-2)^{2}+(-1)^{2}+1^{2}+2^{2}\right)}}}$
${\displaystyle \sigma ={\sqrt {{\frac {1}{4}}\left(4+1+1+4\right)}}}$
${\displaystyle \sigma ={\sqrt {\frac {10}{4}}}}$
${\displaystyle \sigma \approx 1.58114\,\!}$（此为标准差）

## 常态分布的规则

${\displaystyle f(x;\mu ,\sigma ^{2})={\frac {1}{\sigma {\sqrt {2\pi }}}}e^{-{\frac {1}{2}}\left({\frac {x-\mu }{\sigma }}\right)^{2}}}$
${\displaystyle {\text{Proportion}}=\operatorname {erf} \left({\frac {z}{\sqrt {2}}}\right)}$
${\displaystyle {\text{Proportion}}\leq x={\frac {1}{2}}\left[1+\operatorname {erf} \left({\frac {x-\mu }{\sigma {\sqrt {2}}}}\right)\right]={\frac {1}{2}}\left[1+\operatorname {erf} \left({\frac {z}{\sqrt {2}}}\right)\right]}$.[1]
Percentage within(z)
z(Percentage within)

0.318 639σ 25% 75% 3 / 4
0.318 639σ 25% 75% 3 / 4
0.674490σ 50% 50% 1 / 2
0.994458σ 68% 32% 1 / 3.125
1σ 68.2689492% 31.7310508% 1 / 3.1514872
1.281552σ 80% 20% 1 / 5
1.644854σ 90% 10% 1 / 10
1.959964σ 95% 5% 1 / 20
2σ 95.4499736% 4.5500264% 1 / 21.977895
2.575829σ 99% 1% 1 / 100
3σ 99.7300204% 0.2699796% 1 / 370.398
3.290527σ 99.9% 0.1% 1 / 1,000
3.890592σ 99.99% 0.01% 1 / 10,000
4σ 99.993666% 0.006334% 1 / 15,787
4.417173σ 99.999% 0.001% 1 / 100,000
4.5σ 99.9993204653751% 0.0006795346249% 1 / 147,159.5358
3.4 / 1,000,000 (每一边)
4.891638σ 99.9999% 0.0001% 1 / 1,000,000
5σ 99.9999426697% 0.0000573303% 1 / 1,744,278
5.326724σ 99.99999% 0.00001% 1 / 10,000,000
5.730729σ 99.999999% 0.000001% 1 / 100,000,000
6σ 99.9999998027% 0.0000001973% 1 / 506,797,346
6.109410σ 99.9999999% 0.0000001% 1 / 1,000,000,000
6.466951σ 99.99999999% 0.00000001% 1 / 10,000,000,000
6.806502σ 99.999999999% 0.000000001% 1 / 100,000,000,000
7σ 99.9999999997440% 0.000000000256% 1 / 390,682,215,445

## 标准差与平均值之间的关系

${\displaystyle \sigma (\mu )={\sqrt {{\frac {1}{N}}\sum _{i=1}^{N}(x_{i}-\mu )^{2}}}}$

${\displaystyle \mu ={\overline {x}}}$

## 几何学解释

${\displaystyle R=({\overline {x}},{\overline {x}},{\overline {x}})}$

## 参考资料

1. ^ Eric W. Weisstein. Distribution Function. MathWorld—A Wolfram Web Resource. [2014-09-30].