Questions tagged [weighted-average]

The weighted average or weighted mean is similar to an arithmetic mean where instead of each of the data points contributing equally to the final average, some data points contribute more than others.

If all the weights are equal, then the weighted mean is the same as the arithmetic mean.

The mathematical expression for the weighted average is

enter image description here

Read more here

476 questions
0
votes
0 answers

Multi-Objective Bin packing using linear aggregation

I want to load items into an optimal number of containers. Each item is defined by its volume and priority and the containers are defined by their volumes. I want to prioritize the items with the highest priorities. I wrote a best fit, a first fit…
AIR
  • 73
  • 1
  • 9
0
votes
0 answers

Weighted percentage contribution by row in R

I have a matrix of 2 columns. I calculated the percentage contribution of each column by row to the overall using the formula below: B = matrix (c(2,4,3,1,5,7,5,3,8,3,7,3),nrow=6,ncol=2) sweep(B, 1, rowSums(B), FUN="/") This gives the result…
Joke O.
  • 515
  • 6
  • 29
0
votes
1 answer

C# Simple Constrained Weighted Average Algorithm with/without Solver

I'm at a loss as to why I can't get this seemingly simple problem solved using Microsoft Solver Foundation. All I need is to modify the weights (numbers) of certain observations to ensure that no 1 observation's weight AS A PERCENTAGE exceeds 25%.…
Mark Z.
  • 2,127
  • 16
  • 33
0
votes
2 answers

How to use dictionary values to calculate sum of weighted values without explicitly defined weights?

As an example I have a dictionary as follows: mydict = {A:['asdasd',2,3], B:['asdasd',4,5], C:['rgerg',9,10]} How can I get just one number that is essentially the sum of the weighted values of all the keys in the dict (this example: A, B, C)…
FancyDolphin
  • 459
  • 1
  • 7
  • 25
0
votes
1 answer

How to set some weights in a layer to a particulr number?

I would like to ask if it is possible to set some weights in a layer to particular number or zero of pretrained model. For example, I want to download Lecun model and set some weights in the last layer to number e.x 4 and calculate the…
S.AMEEN
  • 1,461
  • 4
  • 16
  • 23
0
votes
1 answer

Excluding zeroes in a weighted average within a Calculated Field of a Pivot Table

I am trying to create a calculated Weighted Average field in an Excel Pivot Table that does NOT include zeroes in the "Total" average row at the bottom of that specific section. I understand how to make the weighted average, but I cannot figure out…
Laurel P
  • 23
  • 1
  • 5
0
votes
2 answers

Simple weighted rating value

I have a database consisting of clubs and its ratings people have provided them with. Currently, I am performing an average of the ratings based on a club and then sorting these averages in descending order to have a list of highest rated…
somejkuser
  • 8,856
  • 20
  • 64
  • 130
0
votes
1 answer

SAS calculate CDF as the percentage of values <= any defined values in a weighted variable

The idea is, for a weighted variable "leadb" in a dataset, starts with a value B, and then finds the CDF as the percentage of values <= B, together with a confidence interval for that percentage. I can do this using PROC SURVEYMEAN for any single…
Vicki1227
  • 151
  • 1
  • 3
  • 10
0
votes
1 answer

How to compute an average runtime?

I have a set of programs and for each program, it contains many subprograms, of which, one subprogram has the longest runtime. My goal is to calculate the the average ratio of (longest runtime)/(entire program runtime). I want to know what is the…
derek
  • 9,358
  • 11
  • 53
  • 94
0
votes
2 answers

SQL weighted average of by dates with missing rows

I have the following table: Date | Flag| Val | Weight 1 | A | 5 | 2 1 | B | 5 | 2 2 | A | 10 | 1 3 | A | 10 | 1 3 | B | 10 | 1 If I do…
qwer
  • 223
  • 4
  • 13
0
votes
1 answer

Weighted average in PivotTable

I have a question which I just can't figure out. I have a pivot table and want to create a weighted average from that data. I have researched and people suggest to do this by using a calculated field. However, my data is structured differently, I…
robs
  • 649
  • 4
  • 13
  • 28
0
votes
1 answer

Loop in R duplicates columns in weighted average calculations

I've got a list of 137 xts objects, each with 4 variables. Each element is a daily series split by months. Example code: recession <- sample(1:100, 4169, replace = TRUE) unemployed <- sample(1:100, 4169, replace = TRUE) jobs <- sample(1:100, 4169,…
0
votes
1 answer

1 raiting subtraction from total weighted rating

This is a 10 star rating. I have a weighted rating of 8.1 made from 25 users ratings. I want to delete 1 user rating (7.5) that is invalid, how i do direct calculation on this? I don't want to recalculate all 24 ratings that are left. I tough of…
PHPCore
  • 121
  • 9
0
votes
0 answers

How to ignore NAs in certain rows to calculate a group-level 5-year weighted average in R

In the attached data.table, I am trying to calculate a 5-year weighted average of the AF2 column. AF2 is a function of other columns in the dataset based upon the following: Region Country Group Item Year Dom.Supply Feed …
Expat_Canuck
  • 113
  • 8
0
votes
1 answer

Weighted-Avg Access Query

Background: I have the following table with clothing brand names, the count of the brand name sold, the revenue the brand name has brought in, and an avg per unit sold of that brand name. Quantity Brand Revenue Rev_Per_Brand 1820 CMD…
Chase
  • 544
  • 1
  • 11
  • 25