3

I was thinking about a way to do a "weighted average" (that's what I call it, could be dead wrong) of a variable $x$ defined for a given range $x_1\leq x\leq x_N$, weighted by an always positive function $f(x)$.

I came up with the following formula:

$\frac{\sum_{i}^N x_i * f(x_i)}{\sum_i^N f(x_i)}$

where $i=1..N$ for any number $N$ of $x$ values. If $f(x)$ is any constant function, then the result is simply $(x_1+ \cdots + x_N)/N$.

The above equation seems rather familiar but I can't figure out what it might be, or if it is anything at all.

Is the above equation some known mathematical concept? Does it even make sense?

John Hughes
  • 93,729
Gabriel
  • 1,355
  • 1
    https://en.wikipedia.org/wiki/Weighted_arithmetic_mean BTW, "if $f(x)$ is constant..." then the result is $(x_1 + x_2 + \cdots + x_N)/N$ – leonbloy Sep 30 '15 at 02:21
  • Beat you by 40 secs :). Seriously, thank you for not downvoting me and instead pointing me to the actual definition. I'm not a mathematician so I tend to be cautious with things I come with myself and for which I have no justification other than I think it should work. – Gabriel Sep 30 '15 at 02:23
  • @leonbloy: I already made that edit in the original question...beat you by 10 seconds. :) – John Hughes Sep 30 '15 at 02:29
  • Also, the restriction $x_1\leq x\leq x_N$ is actually irrelevant. – leonbloy Sep 30 '15 at 02:34

1 Answers1

4

It's called the weighted average. :) Seriously: this is exactly how generalized weighted averages are defined. Nice work inventing it for yourself!

John Hughes
  • 93,729
  • I had so little faith in myself I didn't even bother googling "weighted average". If I did i would've found this: https://en.wikipedia.org/wiki/Weighted_arithmetic_mean#Mathematical_definition. I was afraid that perhaps it would diverge for N-->infinity or something, which is why I asked if it even made any sense. Thank you John! – Gabriel Sep 30 '15 at 02:21