# Inverse-variance weighting

In statistics, inverse-variance weighting is a method of aggregating two or more random variables to minimize the variance of the weighted average. Each random variable is weighted in inverse proportion to its variance.

Given a sequence of independent observations yi with variances σi2, the inverse-variance weighted average is given by

${\hat {y}}={\frac {\sum _{i}y_{i}/\sigma _{i}^{2}}{\sum _{i}1/\sigma _{i}^{2}}}.$ The inverse-variance weighted average has the least variance among all weighted averages, which can be calculated as

$D^{2}({\hat {y}})={\frac {1}{\sum _{i}1/\sigma _{i}^{2}}}.$ If the variances of the measurements are all equal, then the inverse-variance weighted average becomes the simple average.

Inverse-variance weighting is typically used in statistical meta-analysis to combine the results from independent measurements.

## Context

Suppose an experimenter wishes to measure the value of a quantity, say the acceleration due to gravity of Earth, whose true value happens to be $\mu$ . A careful experimenter makes multiple measurements, which we denote with $n$ random variables $X_{1},X_{2},...,X_{n}$ . If they are all noisy but unbiased, i.e., the measuring device does not systematically overestimate or underestimate the true value and the errors are scattered symmetrically, then the expectation value $E[X_{i}]=\mu$ $\forall i$ . The scatter in the measurement is then characterised by the variance of the random variables $Var(X_{i}):=\sigma _{i}^{2}$ , and if the measurements are performed under identical scenarios, then all the $\sigma _{i}$ are the same, which we shall refer to by $\sigma$ . Given the $n$ measurements, a typical estimator for $\mu$ , denoted as ${\hat {\mu }}$ , is given by the simple average ${\overline {X}}={\frac {1}{n}}\sum _{i}X_{i}$ . Note that this empirical average is also a random variable, whose expectation value $E[{\overline {X}}]$ is $\mu$ but also has a scatter. If the individual measurements are uncorrelated, the square of the error in the estimate is given by $Var({\overline {X}})={\frac {1}{n^{2}}}\sum _{i}\sigma _{i}^{2}=\left({\frac {\sigma }{\sqrt {n}}}\right)^{2}$ . Hence, if all the $\sigma _{i}$ are equal, then the error in the estimate decreases with increase in $n$ as $1/{\sqrt {n}}$ , thus making the more number of observations preferred.

Instead of $n$ repeated measurements with one instrument, if the experimenter makes $n$ of the same quantity with $n$ different instruments with varying quality of measurements, then there is no reason to expect the different $\sigma _{i}$ to be the same. Some instruments could be noisier than others. In the example of measuring the acceleration due to gravity, the different "instruments" could be measuring $g$ from a simple pendulum, from analysing a projectile motion etc. The simple average is no longer an optimal estimator, since the error in ${\overline {X}}$ might actually exceed the error in the least noisy measurement if different measurements have very different errors. Instead of discarding the noisy measurements that increase the final error, the experimenter can combine all the measurements with appropriate weights so as to give more importance to the least noisy measurements and vice versa. Given the knowledge of $\sigma _{1}^{2},\sigma _{2}^{2},...,\sigma _{n}^{2}$ , an optimal estimator to measure $\mu$ would be a weighted mean of the measurements ${\hat {\mu }}={\frac {\sum _{i}w_{i}X_{i}}{\sum _{i}w_{i}}}$ , for the particular choice of the weights $w_{i}=1/\sigma _{i}^{2}$ . The variance of the estimator $Var({\hat {\mu }})={\frac {\sum _{i}w_{i}^{2}\sigma _{i}^{2}}{\left(\sum _{i}w_{i}\right)^{2}}}$ , which for the optimal choice of the weights become $Var({\hat {\mu }}_{\text{opt}})=\left(\sum _{i}\sigma _{i}^{-2}\right)^{-1}.$ Note that since $Var({\hat {\mu }}_{\text{opt}})<\min _{j}\sigma _{j}^{2}$ , the estimator has a scatter smaller than the scatter in any individual measurement. Furthermore, the scatter in ${\hat {\mu }}_{\text{opt}}$ decreases with adding more measurements, however noisier those measurements may be.

## Derivation

Consider a generic weighted sum $Y=\sum _{i}w_{i}X_{i}$ , where the weights $w_{i}$ are normalised such that $\sum _{i}w_{i}=1$ . If the $X_{i}$ are all independent, the variance of $Y$ is given by

$Var(Y)=\sum _{i}w_{i}^{2}\sigma _{i}^{2}.$ For optimality, we wish to minimise $Var(Y)$ which can be done by equating the gradient with respect to the weights of $Var(Y)$ to zero, while maintaining the constraint that $\sum _{i}w_{i}=1$ . Using a Lagrange multiplier $w_{0}$ to enforce the constraint, we express the variance

$Var(Y)=\sum _{i}w_{i}^{2}\sigma _{i}^{2}-w_{0}(\sum _{i}w_{i}-1).$ For $k>0$ ,

$0={\frac {\partial }{\partial w_{k}}}Var(Y)=2w_{k}\sigma _{k}^{2}-w_{0},$ which implies that

$w_{k}={\frac {w_{0}/2}{\sigma _{k}^{2}}}.$ The main takeaway here is that $w_{k}\propto 1/\sigma _{k}^{2}$ . Since $\sum _{i}w_{i}=1$ ,

${\frac {2}{w_{0}}}=\sum _{i}{\frac {1}{\sigma _{i}^{2}}}:={\frac {1}{\sigma _{0}^{2}}}.$ The individual normalised weights are

$w_{k}={\frac {1}{\sigma _{k}^{2}}}\left(\sum _{i}{\frac {1}{\sigma _{i}^{2}}}\right)^{-1}.$ It is easy to see that this extremum solution corresponds to the minimum from the second partial derivative test by noting that the variance is a quadratic function of the weights. Thus, the minimum variance of the estimator is then given by

$Var(Y)=\sum _{i}{\frac {\sigma _{0}^{4}}{\sigma _{i}^{4}}}\sigma _{i}^{2}=\sigma _{0}^{4}\sum _{i}{\frac {1}{\sigma _{i}^{2}}}=\sigma _{0}^{4}{\frac {1}{\sigma _{0}^{2}}}=\sigma _{0}^{2}={\frac {1}{\sum _{i}1/\sigma _{i}^{2}}}.$
{"ft_lang_label":"__label__en","ft_lang_prob":0.90150845,"math_prob":0.99995947,"size":4227,"snap":"2019-35-2019-39","text_gpt3_token_len":822,"char_repetition_ratio":0.16812693,"word_repetition_ratio":0.0030075188,"special_character_ratio":0.18902294,"punctuation_ratio":0.101626016,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":1.0000054,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106],"im_url_duplicate_count":[null,5,null,2,null,null,null,null,null,9,null,5,null,null,null,5,null,null,null,null,null,null,null,null,null,null,null,5,null,5,null,null,null,5,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,5,null,null,null,5,null,5,null,5,null,5,null,5,null,5,null,5,null,null,null,null,null,null,null,null,null,5,null,null,null,null,null,null,null,null,null,5,null,null,null,5,null,5,null,5,null,null,null,5,null,5,null,5,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-09-20T18:09:58Z\",\"WARC-Record-ID\":\"<urn:uuid:5bd64631-85cc-4bc8-ab49-f105cd86ac1e>\",\"Content-Length\":\"107690\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:cc882e2b-0664-4466-8656-584872d6b2bd>\",\"WARC-Concurrent-To\":\"<urn:uuid:bbf8e150-9391-4a3d-8c43-a648476e6ee7>\",\"WARC-IP-Address\":\"208.80.154.224\",\"WARC-Target-URI\":\"https://en.wikipedia.org/wiki/Inverse-variance_weighting\",\"WARC-Payload-Digest\":\"sha1:IZLQLWZGLXQV2MIXUECYA6INUQXDADOE\",\"WARC-Block-Digest\":\"sha1:PIVQVRE5U65GDOH6NQVBMYVLMHAMGGYT\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-39/CC-MAIN-2019-39_segments_1568514574058.75_warc_CC-MAIN-20190920175834-20190920201834-00385.warc.gz\"}"}