Aweight function is a mathematical device used when performing a sum, integral, or average to give some elements more "weight" or influence on the result than other elements in the same set. The result of this application of a weight function is aweighted sum orweighted average. Weight functions occur frequently instatistics andanalysis, and are closely related to the concept of ameasure. Weight functions can be employed in both discrete and continuous settings. They can be used to construct systems of calculus called "weighted calculus"[1] and "meta-calculus".[2]
In the discrete setting, a weight function is a positive function defined on adiscreteset, which is typicallyfinite orcountable. The weight function corresponds to theunweighted situation in which all elements have equal weight. One can then apply this weight to various concepts.
If the function is areal-valuedfunction, then theunweightedsum of on is defined as
but given aweight function, theweighted sum orconical combination is defined as
One common application of weighted sums arises innumerical integration.
IfB is afinite subset ofA, one can replace the unweightedcardinality |B| ofB by theweighted cardinality
IfA is afinite non-empty set, one can replace the unweightedmean oraverage
by theweighted mean orweighted average
In this case only therelative weights are relevant.
Weighted means are commonly used instatistics to compensate for the presence ofbias. For a quantity measured multiple independent times withvariance, the best estimate of the signal is obtained by averaging all the measurements with weight, and the resulting variance is smaller than each of the independent measurements. Themaximum likelihood method weights the difference between fit and data using the same weights.
Theexpected value of a random variable is the weighted average of the possible values it might take on, with the weights being the respectiveprobabilities. More generally, the expected value of a function of a random variable is the probability-weighted average of the values the function takes on for each possible value of the random variable.
Inregressions in which thedependent variable is assumed to be affected by both current and lagged (past) values of theindependent variable, adistributed lag function is estimated, this function being a weighted average of the current and various lagged independent variable values. Similarly, amoving average model specifies an evolving variable as a weighted average of current and various lagged values of a random variable.
The terminologyweight function arises frommechanics: if one has a collection of objects on alever, with weights (whereweight is now interpreted in the physical sense) and locations, then the lever will be in balance if thefulcrum of the lever is at thecenter of mass
which is also the weighted average of the positions.
In the continuous setting, a weight is a positivemeasure such as on somedomain, which is typically asubset of aEuclidean space, for instance could be aninterval. Here isLebesgue measure and is a non-negativemeasurablefunction. In this context, the weight function is sometimes referred to as adensity.
If is areal-valuedfunction, then theunweightedintegral
can be generalized to theweighted integral
Note that one may need to require to beabsolutely integrable with respect to the weight in order for this integral to be finite.
IfE is a subset of, then thevolume vol(E) ofE can be generalized to theweighted volume
If has finite non-zero weighted volume, then we can replace the unweightedaverage
by theweighted average
If and are two functions, one can generalize the unweightedbilinear form
to a weighted bilinear form
See the entry onorthogonal polynomials for examples of weightedorthogonal functions.