Σ
SDCalc
AdvancedAdvanced·14 min

Weighted Standard Deviation

Learn how to calculate weighted standard deviation when data points have different importance or frequencies.

What is Weighted Standard Deviation?

When data points have different levels of importance or represent different frequencies, we use weighted standard deviation. This is common in portfolio analysis, survey data with sampling weights, and GPA calculations.

In standard (unweighted) calculations, every data point contributes equally to the mean and standard deviation. But real-world scenarios often require giving some observations more influence than others. A $1 million investment should affect your portfolio's volatility calculation more than a $1,000 position. A survey response from a larger demographic group should carry more weight when estimating population parameters.

When to Use Weighted SD

Use weighted standard deviation whenever your data points have different importance, frequencies, or reliability levels. Unweighted SD assumes all points matter equally—which is often an incorrect assumption.

The Weighted SD Formula

First, you need the weighted mean:

Weighted Mean

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

Then, the weighted standard deviation (population version):

Weighted Standard Deviation (Population)

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

Where wᵢ are the weights, xᵢ are the data values, and x̄w is the weighted mean.

For sample data, use the bias-corrected formula (analogous to Bessel's correction):

Weighted Standard Deviation (Sample)

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

The sample correction is more complex because the "effective sample size" depends on the distribution of weights. If all weights are equal, this reduces to the familiar n-1 correction.

Step-by-Step Calculation

1

Calculate the weighted mean

Multiply each value by its weight, sum these products, and divide by the sum of weights.
2

Calculate weighted squared deviations

For each value, find (value - weighted mean)², then multiply by the weight.
3

Sum the weighted squared deviations

Add all the products from step 2.
4

Divide by sum of weights

For population SD, divide by Σwᵢ. For sample SD, use the bias correction.
5

Take the square root

The final weighted standard deviation.

Real-World Applications

Portfolio Volatility: In finance, portfolio standard deviation must account for different asset allocations. A 50% stock, 50% bond portfolio's volatility is calculated using weighted SD where weights are the allocation percentages.

Survey Analysis: Survey samples often overrepresent or underrepresent certain demographics. Weighting adjusts for this, ensuring that results reflect the true population. The weighted SD captures the variability in the population, not just the sample.

Academic Grading: When calculating GPA, different courses have different credit hours. A 4-credit course should influence your GPA more than a 1-credit course. Weighted calculations handle this naturally.

Meta-Analysis: When combining results from multiple studies, each study is weighted by its precision (often inverse variance). This gives more influence to larger, more precise studies.

Worked Examples

Portfolio Example: Consider a portfolio with three stocks:

  • Stock A: 15% return, 50% allocation (weight = 0.50)
  • Stock B: 8% return, 30% allocation (weight = 0.30)
  • Stock C: -2% return, 20% allocation (weight = 0.20)

Weighted mean = (0.50×15 + 0.30×8 + 0.20×(-2)) / 1.0 = 9.5%

Weighted SD = √[(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%

Notice the Impact

Stock C has only 20% allocation but contributes heavily to volatility because its return deviates significantly from the weighted mean. This is exactly what weighted SD captures—both the deviation and the weight matter.