Author Topic: Formula help  (Read 1574 times)

Shed

  • Newbie
  • *
  • Posts: 15
    • View Profile
Formula help
« on: March 16, 2009, 02:31:43 PM »
I am using the following formulas.

P4P
sqrt(((n * bc) * (bc/tc)))/(r + 1.0)

TS
log((n + 1)/r)

OS

(1-exp(average(scores))) * 100

I run a League that has a game once a month.  I would like to adjust the related formula so that it removes the worst result for each player when calculating the tournament score.  This worst score could be a missed tournament.  Is there a way of doing this? If you think there's a better way of handling it, please let me know.

Jaxen

  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: Formula help
« Reply #1 on: March 16, 2009, 03:57:27 PM »
I too am curious about this. Someone gave me a formula (don't have it handy, it's on laptop at home) that would only count the best 5 scores of the 7 tournaments we have. I too want those 2 dropped to be a missed event if need be. It just dawned on me that if a player plays 5 events, I believe it will only count their top 3 scores (dropping the 2 lowest) rather than all 5.
« Last Edit: March 16, 2009, 04:07:10 PM by Jaxen »

Shed

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Formula help
« Reply #2 on: March 16, 2009, 05:55:27 PM »
I understand the example the user manual gives for dropping the lowest score a player gets (below) but does the application interpret a missed game by a player in the League as a lowest score?

assign ("c", count (scores))
average (top (c-1, scores))

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5420
    • View Profile
Re: Formula help
« Reply #3 on: March 17, 2009, 12:06:08 PM »
Good question.

A missed tournament is simply a score that the player will not have.  For example, if there are 7 tournaments, and a player participated in 5 of them, he will simply have 5 scores.

Dealing with this depends on what your goal is, and there are several ways to do things.

The trick is to use the "n" variable (or "numberOfTournaments") in the Overall Scoring formula.  "count(scores)" in the Overall Scoring formula tells you how many scores this player has, whereas the "n" variable in the Overall Scoring formula tells you how many tournaments have been included in the calculations (how many tournament files passed your filter).

So, if there are 7 tournaments, this will average each player's highest 6 tournaments, regardless of how many scores the player has:

average(top(n - 1, scores))

If the player has participated in only 5 tournaments, it will average those 5 tournament scores.  In other words, it will only drop the lowest score if the player has participated in all tournaments.  Otherwise, it doesn't drop any.

This, on the other hand, will average the player's scores minus the lowest score, regardless of how many scores the player has:

average(top(count(scores)-1, scores))

In other words, it always drops the lowest score.


Now the ugly part.  The "scores" variable holds all of the players scores for the particular set of tournaments.  If the player does not participate in a tournament, they don't get a 0, they simply don't get a score.

As an easy example, if there are 3 tournaments a player might have the scores [50, 75, 100].  A player who only played in 2 tournaments may have [50, 100], NOT [50, 100, 0].

Why does this matter?  The average of [50, 100] is 75, whereas the average of [50, 100, 0] is 50.

Therefore, the problem occurs if you want a missed tournament to count as 0, and thus affect their overall score.  Currently, there's no way to do this (that I can think of).  What probably needs to be done (off the top of my head), is to add an additional variable, like "allscores", which is the same as "scores" except it contains 0 values for tournaments in which the player did not participate.

Shed

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Formula help
« Reply #4 on: March 17, 2009, 02:01:22 PM »
Wow this is great Corey thank you.  The League will have 10 tournaments in the season however I guess my goal is that the players will have the ability to miss one game in the season without it affecting their season ending score. For players that make all the games, their worst score will be dropped.  Since this is my goal I don't believe Option 1 is my choice and not sure 2 is either.  Would the below be more of what I'm after or do you feel it's best to use an average score for the overall?  If a player only makes 8 games, using the below formula, will the app calculate those 8 since it won't be able to find 9?

sum(top(9, scores))

Jaxen

  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: Formula help
« Reply #5 on: March 17, 2009, 03:40:39 PM »
I think in my case of using the top 5 of 7, using the formula    sum(top(5,scores))    would actually work. This one counts up from the bottom, telling the computer to "find all the scores, order them, then count from the top, add the scores as you go down and when you get to the 5th one, stop there." Seems simple enough. It should work, I'll tell you in October after we've played our 7th tournament.

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5420
    • View Profile
Re: Formula help
« Reply #6 on: March 18, 2009, 11:09:57 AM »
Wow this is great Corey thank you.  The League will have 10 tournaments in the season however I guess my goal is that the players will have the ability to miss one game in the season without it affecting their season ending score. For players that make all the games, their worst score will be dropped.  Since this is my goal I don't believe Option 1 is my choice and not sure 2 is either.  Would the below be more of what I'm after or do you feel it's best to use an average score for the overall?  If a player only makes 8 games, using the below formula, will the app calculate those 8 since it won't be able to find 9?

sum(top(9, scores))

The short answer is "yes".

top(9, scores) will return a list of at most 9 values.  So, if "scores" has 10 or more values, "top" will return a list with the greatest 9 values.  If "scores" has 9 or fewer values, "top" will return the entire "scores" list.

For "sum", it doesn't really matter whether the "scores" list contains 0s for missed events or not - the sum will be the same.  It's different for "average" because you average by dividing the sum by the number of values.  The average of [1, 2, 3, 4, 5] is 15 divided by 5, or 3.  The average of [1, 2, 0, 3, 0, 4, 0, 5] is 15 divided by 8, which is 1.875.


Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5420
    • View Profile
Re: Formula help
« Reply #7 on: March 18, 2009, 11:11:44 AM »
I think in my case of using the top 5 of 7, using the formula    sum(top(5,scores))    would actually work. This one counts up from the bottom, telling the computer to "find all the scores, order them, then count from the top, add the scores as you go down and when you get to the 5th one, stop there." Seems simple enough. It should work, I'll tell you in October after we've played our 7th tournament.

Essentially, yes.  Think of "top" as: take this list, sort it by value, return the greatest n values at most (or fewer if that's all there are).