views:

98

answers:

3

Let's say you need to display a graphical representation of how well a baseball team is doing (my software problem is not related to sports but...).

Let say you chose that 25% of a gauge is related to the percentage of batters who hit during the first time at bat. The next 25% related to the percentage of pitchers on the team who threw n number of strikes in a game. The final 50% related to the percentage of batters on the team who scored during a game.

The obvious calculation is (.25 * percentage1) + (.25 * percentage2) + (.5 * percentage3). This will equal some final calculation < 100.

Let's say that you wanted to add some "negative" portion to the algorithm. Example, percentage of fielders who has an error during the game. How would that work as part of the algoritm? I don't think you can say that this percentage is -50% (negative) and then add an additional 50% somewhere to add up to 100%. That won't work because you'll potentially end up with a final calculation > 100.

UPDATED: (to give actual example)

  • Percentage 1 at 25%
  • Percentage 2 at 25%
  • Percentage 3 (this is negative) at -50%
  • Percentage 4 at ??? 100%

If we total the percentages then we are at 100%, but the calculations can come out to be > 100.

+1  A: 

Just add it in. If the fielders are perfect, their error rate is 0, 0*(-.5) = 0, your calculation still has a possible maximum of 1. You don't need any correction factor.

mtrw
Thanks for the response, I don't see it. Can you use my updated example (Percentage 1-4 at their respective weights) as an example? For me I can still get > 1 (or 100) using weights that add up to 100% but including a negative percent.
Arthur Frankel
I would leave percentage 4 in your updated example at 50%. Then, if every player is perfect, the result is 100%. If everyone EXCEPT the fielders are perfect, and fielders are maximally awful, the result is 50%, reflecting the reduced chance of winning.
mtrw
I like that! I'll just have to have a rule that positives must add up to 100% and negatives can be anything between 0 and 100%
Arthur Frankel
A: 

You can measure how well a team did in comparison to an arbitrary limit, or possibly the worst of all the teams.

So, if you want errors to count for 50%, with an arbitrary limit of 100

.5 * (100 - NumberOfErrors)

Or you can measure a team against the worst in the league

.5 * 100 * (MostErrorsInTheLeague - NumberOfErrors) / MostErrorsInTheLeague

This way, the worst team will get a score of zero for that factor, and a team with zero errors will get the full fifty.

whooops
I think your second comment is potentially something I can do. The issue is that I don't know what is "negative". In my example, it's obvious that fielding errors in a game is bad. In my world there are several of these algorithms and it's really up to the user to define that this is "bad" and should have a negative impact on the overall calculation. If the user can define it as "negative" then I can use your second calculation. Let me think about this more, but thanks - I think that's a posibility.
Arthur Frankel
A: 

Mean Squared Error
Root Mean Square Deviation

One of these two terms should work well for comparing two algorithms where the error can be negative as well as positive.

ceretullis