Σ
SDCalc
進階進階主題·14 min

加權標準差

學習當資料點具有不同重要性或頻率時,如何計算加權標準差。

什麼是加權標準差?

當資料點具有不同的重要性或代表不同的頻率時,我們使用加權標準差。這在投資組合分析、帶有抽樣權重的調查資料以及 GPA 計算中很常見。

在標準(未加權)計算中,每個資料點對平均數和標準差的貢獻是相等的。但現實中的場景常常需要讓某些觀測值比其他的有更大的影響力。一筆 100 萬元的投資對你的投資組合波動性計算的影響,理應大於一筆 1,000 元的部位。來自較大人口群體的調查回覆,在估計母體參數時也應該有更大的權重。

何時使用加權標準差

當你的資料點具有不同的重要性、頻率或可靠度時,就應該使用加權標準差。未加權的標準差假設所有資料點同等重要——這往往是一個不正確的假設。

加權標準差公式

首先,你需要計算加權平均數:

加權平均數

x̄w = Σ(wᵢxᵢ) / Σwᵢ

然後,計算加權標準差(母體版本):

加權標準差(母體)

σw = √[Σwᵢ(xᵢ - x̄w)² / Σwᵢ]

其中 wᵢ 是權重,xᵢ 是資料值,x̄w 是加權平均數。

若為樣本資料,使用偏差校正公式(類似於貝塞爾校正):

加權標準差(樣本)

sw = √[Σwᵢ(xᵢ - x̄w)² / (Σwᵢ - Σwᵢ²/Σwᵢ)]

樣本校正較為複雜,因為“有效樣本數”取決於權重的分佈。如果所有權重相等,就會退化為熟悉的 n-1 校正。

逐步計算

1

計算加權平均數

將每個數值乘以其權重,加總這些乘積,再除以權重的總和。
2

計算加權偏差平方

對每個數值,求 (數值 - 加權平均數)²,然後乘以權重。
3

加總加權偏差平方

將步驟二的所有乘積加總。
4

除以權重總和

母體標準差除以 Σwᵢ。樣本標準差則使用偏差校正。
5

取平方根

得到最終的加權標準差。

實際應用

投資組合波動性: 在金融領域,投資組合的標準差必須考慮不同的資產配置比例。一個 50% 股票、50% 債券的投資組合,其波動性計算中權重就是配置百分比。

調查分析: 調查樣本經常過度或不足代表某些人口群體。加權可以調整這個問題,確保結果反映真正的母體。加權標準差捕捉的是母體中的變異性,而不僅僅是樣本中的。

學業成績: 計算 GPA 時,不同課程有不同的學分數。一門 4 學分的課程對你的 GPA 影響理應大於 1 學分的課程。加權計算自然處理了這個問題。

統合分析: 合併多項研究的結果時,每項研究會根據其精確度(通常是變異數的倒數)來加權。這讓較大、較精確的研究有更大的影響力。

計算範例

投資組合範例: 考慮一個包含三支股票的投資組合:

  • 股票 A:報酬率 15%,配置 50%(權重 = 0.50)
  • 股票 B:報酬率 8%,配置 30%(權重 = 0.30)
  • 股票 C:報酬率 -2%,配置 20%(權重 = 0.20)

加權平均 = (0.50×15 + 0.30×8 + 0.20×(-2)) / 1.0 = 9.5%

加權標準差 = √[(0.50×(15-9.5)² + 0.30×(8-9.5)² + 0.20×(-2-9.5)²)] = √[(0.50×30.25 + 0.30×2.25 + 0.20×132.25)] = √[15.125 + 0.675 + 26.45] = √42.25 = 6.5%

注意影響力

股票 C 只佔 20% 的配置,但由於其報酬率與加權平均數偏差很大,因此對波動性貢獻顯著。這正是加權標準差所捕捉的——偏差和權重同時發揮作用。

Further Reading

How to Read This Article

A statistics tutorial is a practical interpretation guide, not just a formula dump. It refers to the assumptions, notation, and reporting language that analysts need when they explain a result to a teacher, manager, client, or reviewer. The article body covers the specific topic, while the sections below create a common interpretation frame that readers can reuse across related metrics.

Reading goalWhat to focus onCommon mistake
DefinitionWhat the metric is and what quantity it summarizesTreating the formula as self-explanatory
Formula choiceSample versus population assumptions and notationUsing n when n-1 is required or vice versa
InterpretationWhether the result indicates concentration, spread, or riskCalling a large value good or bad without context

Frequently Asked Questions

How should I interpret a high standard deviation?

A high standard deviation means the observations are spread farther from the mean on average. Whether that spread is acceptable depends on the context: wide dispersion might signal risk in finance, instability in manufacturing, or genuine natural variation in scientific data.

Why do some articles mention n while others mention n-1?

The denominator reflects the difference between population and sample formulas. Population variance and population standard deviation use N because the full dataset is known. Sample variance and sample standard deviation often use n-1 because Bessel’s correction reduces bias when estimating population spread from a sample.

What is a statistical interpretation guide?

A statistical interpretation guide is a page that moves beyond arithmetic and explains meaning. It tells you what a metric is, when the formula applies, and how to describe the result in plain English without overstating certainty.

Can I cite this article in a report?

You should cite the underlying authoritative reference for formal work whenever possible. This page is best used as an explanatory bridge that helps you understand the concept before quoting the original standard or handbook.

Why include direct citations on every article page?

Direct citations give readers a route to verify the definition, notation, and assumptions. That improves trust and reduces the chance that a simplified explanation is mistaken for the entire technical standard.

Authoritative References

These sources define the concepts referenced most often across our articles. Bessel's correction is a sample adjustment, variance is a squared measure of spread, and standard deviation is the square root of variance expressed in the same units as the data.