# Estimating standard deviation from wheighted sample

The standard deviation is given by $\sqrt{\frac {\sum (x_i -x)^2}n}$, however when we estimate the standart deviation from a sample, the best estimation is $\sqrt{\frac {\sum (x_i -x)^2}{n-1}}$

How do I have to adjust the standarddeviation if I want to wheight my samples?

I.e. the standard deviation would be $\sqrt{\frac {\sum w(x_i)(x_i -x)^2}{\sum w(x_i)}}$, if I had the entire data set. What is the correct estimation of the standard deviation, if I'm only given a subsample of the population?

Both options have some advantages, the choice would depend on the application. If we let $T$ denote the estimator of a parameter $\theta$, then the so-called mean squared error $MSE_{\theta}(T)$ satisfies $$MSE_{\theta}(T) = Var_{\theta}(T) + (E_{\theta}(T) - \theta)^2.$$ The latter term $(E_{\theta}(T) - \theta)^2$ is called the bias of an estimator. $E$ and $Var$ denote expectation and variance, respectively. In this case, it is known that the first choice with $s^2 = \frac{\sum (\overline{x} - x_i)^2}{n}$ is biased, and the use of the second option with $n-1$ in the denominator is referred to as Bessel's correction, since it provides an unbiased estimator. However, since the denominator gets smaller, the variance grows. This may also result in an increase in mean squared error. Thus, it depends on whether you prefer an unbiased estimator or smaller variance.
• I understand that the different std depend on the application, But how can I adapt the wheighted version, such that it resembles the the version with $n-1$? Oct 20, 2017 at 6:50
• I did not have prior knowledge on weighted standard variance, but it seems like there exists alternative definitions for that. For instance, itl.nist.gov/div898/software/dataplot/refman2/ch2/weightsd.pdf provides a definition so that one can obtain the Bessel corrected standard deviation for $w_i = 1, \forall i$. Oct 20, 2017 at 17:52