I have several weighted values for which I am taking a weighted average. I want to calculate a weighted standard deviation using the weighted values and weighted average. How would I modify the typical standard deviation to include weights on each measurement?
This is the standard deviation formula I am using.
When I simply use each weighted value for 'x' and the weighted average for '\bar{x}', the result seems smaller than it should be.
The standard deviation is an indicator of how widely values in a group differ from the mean (see StDev (Standard Deviation of a Sample)). It is useful for comparing different sets of values with a similar mean.
The standard deviation of the portfolio variance is given by the square root of the variance. In the calculation of the variance for a portfolio that consists of multiple assets, one should calculate the factor (2𝑤1𝑤2Cov1,2) or (2𝑤1𝑤2ρ𝑖,𝑗σ𝑖σ𝑗)for each pair of assets in the portfolio.
I just found this wikipedia page discussing data of equal significance vs weighted data. The correct way to calculate the biased weighted estimator of variance is
,
though the following, on-the-fly implementation, is more efficient computationally as it does not require calculating the weighted average before looping over the sum on the weighted differences squared
.
Despite my skepticism, I tried both and got the exact same results.
Note, be sure to use the weighted average
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With