Length-weighted meanFor weighting a response variable based upon its dependency on x, a distance variable. ExampleLet's say we had two school classes, one with 20 students, and one with 30 students. The grades in each class on a particular test were:
The straight average for the morning class is 80% and the straight average of the afternoon class is 90%. If we were to find a straight average of 80% and 90%, we would get 85% for the mean of the two class averages. However, this is not the average of all the students' grades. To find that, you would need to total all the grades and divide by the total number of students: Or, you could find the weighted average of the two class means already calculated, using the number of students in each class as the weighting factor: Note that if we no longer had the individual students' grades, but only had the class averages and the number of students in each class, we could still find the mean of all the students grades, in this way, by finding the weighted mean of the two class averages. Convex combinationSince only the relative weights are relevant, any weighted mean can be expressed using coefficients that sum to one. Such a linear combination is called a convex combination. Using the previous example, we would get the following: This simplifies to: Dealing with varianceFor the weighted mean of a list of data for which each element The weighted mean in this case is: and the variance of the weighted mean is: which reduces to The significance of this choice is that this weighted mean is the maximum likelihood estimator of the mean of the probability distributions under the assumption that they are independent and normally distributed with the same mean. Weighted sample varianceTypically when you calculate a mean it is important to know the variance and standard deviation of that mean. When a weighted mean μ * is used, the variance of the weighted sample is different from the variance of the unweighted sample. The biased weighted sample variance is defined similarly to the normal biased sample variance: For small sample of populations, it is customary to use an unbiased estimator for the population variance. In normal unweighted samples, the N in the denominator (corresponding to the sample size) is changed to N − 1. While this is simple in unweighted samples, it becomes tedious for weighted samples. Thus, the unbiased estimator of weighted population variance is given by [1]:
The standard deviation is simply the square root of the variance above. Accounting for correlationsIn the general case, suppose that and See alsoReferences
External links
| |