# 標準差

1. 為非負數值（因為平方後再做平方根）；
2. 與測量資料具有相同單位（這樣才能比對）。

## 母體的標準差

### 基本定義

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

${\displaystyle \mu }$為平均值。

### 簡化計算公式

{\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 {\begin{aligned}\sigma &={\sqrt {{\frac {1}{N}}\sum _{i=1}^{N}(X_{i}-\mu )^{2}}}\\&={\sqrt {{\frac {1}{N}}\left(\sum _{i=1}^{N}X_{i}^{2}\right)-{\frac {1}{N}}N\mu ^{2}}}\\&={\sqrt {{\frac {\sum _{i=1}^{N}X_{i}^{2}}{N}}-\mu ^{2}}}\end{aligned}}}

### 母體為隨機變數

${\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}\,f(x)\,dx}}}$

${\displaystyle \mu =\int x\,f(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 {\begin{aligned}{\overline {x}}&={\frac {1}{4}}\sum _{i=1}^{4}x_{i}&(N=4)\\&={\frac {1}{4}}\left(x_{1}+x_{2}+x_{3}+x_{4}\right)\\&={\frac {1}{4}}\left(5+6+8+9\right)\\&=7.\end{aligned}}}
• 第二步，計算標準差${\displaystyle \sigma \,}$
{\displaystyle {\begin{aligned}\sigma &={\sqrt {{\frac {1}{N}}\sum _{i=1}^{N}(x_{i}-{\overline {x}})^{2}}}\\&={\sqrt {{\frac {1}{4}}\sum _{i=1}^{4}(x_{i}-{\overline {x}})^{2}}}&(N=4)\\&={\sqrt {{\frac {1}{4}}\sum _{i=1}^{4}(x_{i}-7)^{2}}}&({\overline {x}}=7)\\&={\sqrt {{\frac {1}{4}}\left[(x_{1}-7)^{2}+(x_{2}-7)^{2}+(x_{3}-7)^{2}+(x_{4}-7)^{2}\right]}}\\&={\sqrt {{\frac {1}{4}}\left[(5-7)^{2}+(6-7)^{2}+(8-7)^{2}+(9-7)^{2}\right]}}\\&={\sqrt {{\frac {1}{4}}\left((-2)^{2}+(-1)^{2}+1^{2}+2^{2}\right)}}\\&={\sqrt {{\frac {1}{4}}\left(4+1+1+4\right)}}\\&={\sqrt {\frac {10}{4}}}\\&\approx 1.58114\,.\end{aligned}}}

## 常態分布的規則

${\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]

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 / 1000
3.890592σ 99.99% 0.01% 1 / 10000
4σ 99.993666% 0.006334% 1 / 15787
4.417173σ 99.999% 0.001% 1 / 100000
4.5σ 99.9993204653751% 0.0006795346249% 1 / 147159.5358
3.4 / 1000000 (每一邊)
4.891638σ 99.9999% 0.0001% 1 / 1000000
5σ 99.9999426697% 0.0000573303% 1 / 1744278
5.326724σ 99.99999% 0.00001% 1 / 10000000
5.730729σ 99.999999% 0.000001% 1 / 100000000
6σ 99.9999998027% 0.0000001973% 1 / 506797346
6.109410σ 99.9999999% 0.0000001% 1 / 1000000000
6.466951σ 99.99999999% 0.00000001% 1 / 10000000000
6.806502σ 99.999999999% 0.000000001% 1 / 100000000000
7σ 99.9999999997440% 0.000000000256% 1 / 390682215445

## 標準差與平均值之間的關係

${\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]. （原始內容存檔於2021-04-02）.