A
weight 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 a
weighted sum or
weighted average. Weight functions occur frequently in
statistics and analysis, and are closely related to the concept of a measure. Weight functions can be employed in both discrete and continuous settings. They can be used to construct systems of calculus called "weighted calculus"
[Jane Grossman, Michael Grossman, Robert Katz. First Systems of Weighted Differential and Integral Calculus, , 1980.] and "metacalculus".
[Jane Grossman. MetaCalculus: Differential and Integral, , 1981.]
Discrete weights
General definition
In the discrete setting, a weight function
$\backslash scriptstyle\; w\backslash colon\; A\; \backslash to\; \{\backslash Bbb\; R\}^+$ is a positive function defined on a discrete set
$A$, which is typically
finite set or
countable. The weight function
$w(a)\; :=\; 1$ corresponds to the
unweighted situation in which all elements have equal weight. One can then apply this weight to various concepts.
If the function $\backslash scriptstyle\; f\backslash colon\; A\; \backslash to\; \{\backslash Bbb\; R\}$ is a real numbervalued function, then the unweighted summation of $f$ on $A$ is defined as
 $\backslash sum\_\{a\; \backslash in\; A\}\; f(a);$
but given a weight function $\backslash scriptstyle\; w\backslash colon\; A\; \backslash to\; \{\backslash Bbb\; R\}^+$, the weighted sum or conical combination is defined as
 $\backslash sum\_\{a\; \backslash in\; A\}\; f(a)\; w(a).$
One common application of weighted sums arises in numerical integration.
If B is a finite set subset of A, one can replace the unweighted cardinality B of B by the weighted cardinality
 $\backslash sum\_\{a\; \backslash in\; B\}\; w(a).$
If A is a finite set nonempty set, one can replace the unweighted mean or average
 $\backslash frac\{1\}$ \sum_{a \in A} f(a)
by the weighted mean or weighted average
 $\backslash frac\{\backslash sum\_\{a\; \backslash in\; A\}\; f(a)\; w(a)\}\{\backslash sum\_\{a\; \backslash in\; A\}\; w(a)\}.$
In this case only the relative weights are relevant.
Statistics
Weighted means are commonly used in
statistics to compensate for the presence of bias. For a quantity
$f$ measured multiple independent times
$f\_i$ with
variance $\backslash scriptstyle\backslash sigma^2\_i$, the best estimate of the signal is obtained
by averaging all the measurements with weight
$\backslash scriptstyle\; w\_i=\backslash frac\; 1\; \{\backslash sigma\_i^2\}$, and
the resulting variance is smaller than each of the independent measurements
$\backslash scriptstyle\backslash sigma^2=1/\backslash sum\; w\_i$. The maximum likelihood method weights the difference between fit and data using the same weights
$w\_i$.
The expected value of a random variable is the weighted average of the possible values it might take on, with the weights being the respective probability. More generally, the expected value of a function of a random variable is the probabilityweighted average of the values the function takes on for each possible value of the random variable.
In regressions in which the dependent variable is assumed to be affected by both current and lagged (past) values of the independent variable, a distributed lag function is estimated, this function being a weighted average of the current and various lagged independent variable values. Similarly, a moving average model specifies an evolving variable as a weighted average of current and various lagged values of a random variable.
Mechanics
The terminology
weight function arises from
mechanics: if one has a collection of
$n$ objects on a
lever, with weights
$\backslash scriptstyle\; w\_1,\; \backslash ldots,\; w\_n$ (where
weight is now interpreted in the physical sense) and locations :
$\backslash scriptstyle\backslash boldsymbol\{x\}\_1,\backslash dotsc,\backslash boldsymbol\{x\}\_n$, then the lever will be in balance if the
Lever of the lever is at the center of mass
 $\backslash frac\{\backslash sum\_\{i=1\}^n\; w\_i\; \backslash boldsymbol\{x\}\_i\}\{\backslash sum\_\{i=1\}^n\; w\_i\},$
which is also the weighted average of the positions $\backslash scriptstyle\backslash boldsymbol\{x\}\_i$.
Continuous weights
In the continuous setting, a weight is a positive measure such as
$w(x)\; \backslash ,\; dx$ on some domain
$\backslash Omega$,which is typically a
subset of a
Euclidean space $\backslash scriptstyle\{\backslash Bbb\; R\}^n$, for instance
$\backslash Omega$ could be an interval
$a,b$. Here
$dx$ is
Lebesgue measure and
$\backslash scriptstyle\; w\backslash colon\; \backslash Omega\; \backslash to\; \backslash R^+$ is a nonnegative
measurable function. In this context, the weight function
$w(x)$ is sometimes referred to as a
density.
General definition
If
$f\backslash colon\; \backslash Omega\; \backslash to\; \{\backslash Bbb\; R\}$ is a
real numbervalued function, then the
unweighted integral
 $\backslash int\_\backslash Omega\; f(x)\backslash \; dx$
can be generalized to the weighted integral
 $\backslash int\_\backslash Omega\; f(x)\; w(x)\backslash ,\; dx$
Note that one may need to require $f$ to be absolutely integrable with respect to the weight $w(x)\; \backslash ,\; dx$ in order for this integral to be finite.
Weighted volume
If
E is a subset of
$\backslash Omega$, then the
volume vol(
E) of
E can be generalized to the
weighted volume
 $\backslash int\_E\; w(x)\backslash \; dx,$
Weighted average
If
$\backslash Omega$ has finite nonzero weighted volume, then we can replace the unweighted
average
 $\backslash frac\{1\}\{\backslash mathrm\{vol\}(\backslash Omega)\}\; \backslash int\_\backslash Omega\; f(x)\backslash \; dx$
by the weighted average
 $\backslash frac\{\backslash int\_\backslash Omega\; f(x)\backslash \; w(x)\; dx\}\{\backslash int\_\backslash Omega\; w(x)\backslash \; dx\}$
Bilinear form
If
$f\backslash colon\; \backslash Omega\; \backslash to\; \{\backslash Bbb\; R\}$ and
$g\backslash colon\; \backslash Omega\; \backslash to\; \{\backslash Bbb\; R\}$ are two functions, one can generalize the unweighted
bilinear form
 $\backslash langle\; f,\; g\; \backslash rangle\; :=\; \backslash int\_\backslash Omega\; f(x)\; g(x)\backslash \; dx$
to a weighted bilinear form
 $\backslash langle\; f,\; g\; \backslash rangle\; :=\; \backslash int\_\backslash Omega\; f(x)\; g(x)\backslash \; w(x)\backslash \; dx.$
See the entry on orthogonal polynomials for examples of weighted orthogonal functions.
See also

Center of mass

Numerical integration

Orthogonality

Weighted mean

Kernel (statistics)

Measure (mathematics)

Riemannâ€“Stieltjes integral