Weighted average of weigthed data Consider the following figure where we want to compute the average value on the y-axis. The y-axis is a rate, e.g Km/h.

For that we can use weighted average and do something like this
      (9*35.2) + (41*13) + (24.6*112) + (43.3*5.6)
  ----------------------------------------------------   =  23.2 
             (35.2 + 13 + 112 + 5.6)

Now, consider that each rectangle has a weight. That means, the weight vector associated with (K1,K2,K3,K4) is (0.21,0.07,0.67,0.035).
The question is, how can I get the average value with respect to the weights associated with each part? I would like to call it, double weighted average (!)
 A: $x_i y_i$ is a size of the rectangle $K_i$, just calculate weighted average of those.
A: It depends on the unit your weights are associated with. From what I can understand from the question, your weight vector may be associated in two ways:

*

*Weights are associated with y-axis (i.e. rate):

  In this case you need to multiply the individual weights with the x-length of your individual rectangles, and your average becomes
      (9*35.2*0.21) + (41*13*0.07) + (24.6*112*0.67) + (43.3*5.6*0.035)
  --------------------------------------------------------------------------
             (35.2*0.21 + 13*0.07 + 112*0.67 + 5.6*0.035)

  This is because no matter how many layers of weights you want to apply, they have a multiplicative effect.


*Weights are associated with rectangles (i.e. their areas):

  Here your intention would be to calculate weighted average area of the rectangles (e.g. distance in a speed-time setting), and your average becomes
      (9*35.2*0.21) + (41*13*0.07) + (24.6*112*0.67) + (43.3*5.6*0.035)
  --------------------------------------------------------------------------
             (0.21 + 0.07 + 0.67 + 0.035)

   Basically, the length of x-axis is no more acting as a weight in this case and has been removed from the denominator.
