wolfbiter / mtg40

dan's 40-card decks, stored and displayed as a meteor project
0 stars 0 forks source link

add deck and player rankings #13

Closed wolfbiter closed 9 years ago

wolfbiter commented 9 years ago

email from joel:

Hey dude,

This kind of data analysis is an iterative process, in the sense that your first effort is a little "stupid" but what you learn from the first attempt will inform your next attempt and your future improvements, etc.

What I would first do is consider the most simple system: each deck is assigned a "power" rating, and that "power" rating determines its likelihood of beating another deck in a single game (note game, not match!). You'll have to decide what that power rating means: for ease, you could consider taking the ELO formula, which is well-understood and for which the math is already determined ("A player whose rating is 100 points greater than their opponent's is expected to score 64%; if the difference is 200 points, then the expected score for the stronger player is 76%.").

Once you decide on a ranking system, then you can "fit" the deck power ratings to the win/loss data. Is this something you've done before-- performing a fit?

Anyway, that would be the basic idea. The next steps would be complexifying the model, by for example adding in players by assuming they "modify" the deck's ELO, and then fitting to the data for the strength of that modification. You can make the model even more realistic by modifying the probabilities for certain matchups, e.g. a control deck gets +30 ELO when playing a big-creatures deck, etc.

wolfbiter commented 9 years ago

https://github.com/tlhunter/node-arpad

wolfbiter commented 9 years ago

TODO:

var Elo = require('arpad');

var uscf = {
  default: 32,
  2100: 24,
  2400: 16
};

var elo = new Elo(uscf, 100);

var alice = 2090;
var bob = 2700;

var odds_alice_wins = elo.expectedScore(alice, bob);
console.log("The odds of Alice winning are about:", odds_alice_wins); // ~2.9%
alice = elo.newRating(odds_alice_wins, 1.0, alice);
console.log("Alice's new rating after she won:", alice); // 2121

odds_alice_wins = elo.expectedScore(alice, bob);
console.log("The odds of Alice winning again are about:", odds_alice_wins); // ~3.4%
alice = elo.newRating(odds_alice_wins, 1.0, alice);
console.log("Alice's new rating if she won again:", alice); // 2144