# Weight function

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Weight_function
> Markdown URL: https://mediated.wiki/source/Weight_function.md
> Source: https://en.wikipedia.org/wiki/Weight_function
> Source revision: 1339934578
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{Use American English|date = March 2019}}
{{Short description|Construct related to weighted sums and averages}}
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](/source/weighted_average). Weight functions occur frequently in [statistics](/source/statistics) and [analysis](/source/mathematical_analysis), and are closely related to the concept of a [measure](/source/measure_(mathematics)).  Weight functions can be employed in both discrete and continuous settings. They can be used to construct systems of calculus called "weighted calculus"<ref>Jane Grossman, Michael Grossman, Robert Katz. [https://books.google.com/books?as_brr=0&q=%22The+First+Systems+of+Weighted+Differential+and+Integral+Calculus%E2%80%8E%22&btnG=Search+Books, ''The First Systems of Weighted Differential and Integral Calculus''], {{isbn|0-9771170-1-4}}, 1980.</ref> and "meta-calculus".<ref>Jane Grossman.[https://books.google.com/books?q=%22Non-Newtonian+Calculus%22&btnG=Search+Books&as_brr=0, ''Meta-Calculus: Differential and Integral''], {{isbn|0-9771170-2-2}}, 1981.</ref>

== Discrete weights ==
=== General definition ===
In the discrete setting, a weight function <math>w \colon A \to \R^+</math> is a positive function defined on a [discrete](/source/discrete_mathematics) [set](/source/Set_(mathematics)) <math>A</math>, which is typically [finite](/source/finite_set) or [countable](/source/countable).  The weight function <math>w(a) := 1</math> corresponds to the ''unweighted'' situation in which all elements have equal weight.  One can then apply this weight to various concepts.

If the function <math>f\colon A \to \R</math> is a [real](/source/real_number)-valued [function](/source/mathematical_function), then the ''unweighted [sum](/source/summation) of <math>f</math> on <math>A</math>'' is defined as

:<math>\sum_{a \in A} f(a);</math>

but given a ''weight function'' <math>w\colon A \to \R^+</math>, the '''weighted sum''' or [conical combination](/source/conical_combination) is defined as

:<math>\sum_{a \in A} f(a) w(a).</math>

One common application of weighted sums arises in [numerical integration](/source/numerical_integration).

If ''B'' is a [finite](/source/finite_set) subset of ''A'', one can replace the unweighted [cardinality](/source/cardinality) |''B''| of ''B'' by the ''weighted cardinality'' 

:<math>\sum_{a \in B} w(a).</math>

If ''A'' is a [finite](/source/finite_set) non-empty set, one can replace the unweighted [mean](/source/mean) or [average](/source/average) 

:<math>\frac{1}{|A|} \sum_{a \in A} f(a)</math>

by the [weighted mean](/source/weighted_mean) or [weighted average](/source/weighted_average) 

:<math> \frac{\sum_{a \in A} f(a) w(a)}{\sum_{a \in A} w(a)}.</math>

In this case only the ''relative'' weights are relevant.

=== Statistics ===
Weighted means are commonly used in [statistics](/source/statistics) to compensate for the presence of [bias](/source/Bias_(statistics)).  For a quantity <math>f</math> measured multiple independent times <math>f_i</math> with [variance](/source/variance) <math>\sigma^2_i</math>, the best estimate of the signal is obtained  by averaging all the measurements with weight {{nowrap|<math display="inline">w_i = 1 / {\sigma_i^2}</math>,}} and the resulting variance is smaller than each of the independent measurements {{nowrap|<math display="inline"> \sigma^2 = 1 / \sum_i w_i</math>.}} The [maximum likelihood](/source/maximum_likelihood) method weights the difference between fit and data using the same weights {{nowrap|<math>w_i</math>.}}

The [expected value](/source/expected_value) of a random variable is the weighted average of the possible values it might take on, with the weights being the respective [probabilities](/source/probability). 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.

In [regressions](/source/linear_regression) in which the [dependent variable](/source/dependent_variable) is assumed to be affected by both current and lagged (past) values of the [independent variable](/source/independent_variable), a [distributed lag](/source/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](/source/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](/source/mechanics): if one has a collection of <math>n</math> objects on a [lever](/source/lever), with weights <math>w_1, \ldots, w_n</math> (where [weight](/source/weight) is now interpreted in the physical sense) and locations {{nowrap|<math>\boldsymbol{x}_1,\dotsc,\boldsymbol{x}_n</math>,}} then the lever will be in balance if the [fulcrum](/source/Lever) of the lever is at the [center of mass](/source/center_of_mass) 

:<math>\frac{\sum_{i=1}^n w_i \boldsymbol{x}_i}{\sum_{i=1}^n w_i},</math>

which is also the weighted average of the positions {{nowrap|<math>\boldsymbol{x}_i</math>.}}

== Continuous weights ==
In the continuous setting, a weight is a positive [measure](/source/measure_(mathematics)) such as <math>w(x) \, dx</math> on some [domain](/source/domain_(mathematical_analysis)) <math>\Omega</math>, which is typically a [subset](/source/subset) of a [Euclidean space](/source/Euclidean_space) <math>\R^n</math>. For instance, <math>\Omega</math> could be an [interval](/source/Interval_(mathematics)) <math>[a,b]</math>.  Here <math>dx</math> is [Lebesgue measure](/source/Lebesgue_measure) and <math>w\colon \Omega \to \R^+</math> is a non-negative [measurable](/source/measurable) [function](/source/mathematical_function).  In this context, the weight function <math>w(x)</math> is sometimes referred to as a [density](/source/density).

=== General definition ===
If <math>f\colon \Omega \to \R</math> is a [real](/source/real_number)-valued [function](/source/mathematical_function), then the ''unweighted'' [integral](/source/integral)

:<math>\int_\Omega f(x)\ dx</math>

can be generalized to the ''weighted integral'' 

:<math>\int_\Omega f(x) w(x)\, dx</math>

Note that one may need to require <math>f</math> to be [absolutely integrable](/source/absolutely_integrable_function) with respect to the weight <math>w(x) \, dx</math> in order for this integral to be finite.

=== Weighted volume ===
If ''E'' is a subset of <math>\Omega</math>, then the [volume](/source/volume) vol(''E'') of ''E'' can be generalized to the ''weighted volume'' 
:<math> \int_E w(x)\ dx,</math>

=== Weighted average ===
If <math>\Omega</math> has finite non-zero weighted volume, then we can replace the unweighted [average](/source/average) 

:<math>\frac{1}{\mathrm{vol}(\Omega)} \int_\Omega f(x)\ dx</math>

by the '''weighted average''' 

:<math> \frac{\displaystyle\int_\Omega f(x)\, w(x) \, dx}{\displaystyle\int_\Omega w(x) \, dx}</math>

=== Bilinear form ===
If <math> f\colon \Omega \to {\mathbb R}</math> and <math> g\colon \Omega \to {\mathbb R}</math> are two functions, one can generalize the unweighted [bilinear form](/source/bilinear_form) 

:<math>\langle f, g \rangle := \int_\Omega f(x) g(x)\ dx</math>

to a weighted bilinear form 

:<math>{\langle f, g \rangle}_w := \int_\Omega f(x) g(x) w(x)\ dx.</math>

See the entry on [orthogonal polynomials](/source/orthogonal_polynomials) for examples of weighted [orthogonal functions](/source/orthogonal_functions).

== See also ==
* [Center of mass](/source/Center_of_mass)
* [Numerical integration](/source/Numerical_integration)
* [Orthogonality](/source/Orthogonality)
* [Weighted mean](/source/Weighted_mean)
* [Linear combination](/source/Linear_combination)
* [Kernel (statistics)](/source/Kernel_(statistics))
* [Measure (mathematics)](/source/Measure_(mathematics))
* [Riemann–Stieltjes integral](/source/Riemann%E2%80%93Stieltjes_integral)
* [Weighting](/source/Weighting)
* [Window function](/source/Window_function)

==References==
{{Reflist}}

{{DEFAULTSORT:Weight Function}}
Category:Mathematical analysis
Category:Measure theory
Category:Combinatorial optimization
Category:Functional analysis
Category:Types of functions

---
Adapted from the Wikipedia article [Weight function](https://en.wikipedia.org/wiki/Weight_function) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Weight_function?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
