Jaxel Posted May 13, 2010 Share Posted May 13, 2010 I'm trying to put together a function that will update the trueskill scores for a player in a 2 player (1v1) system. However, I've been perusing the Microsoft Research Article and I am thoroughly confused as I am not a mathematician. Basically a player has two values that calculate their ranking: $player['m'] (mu) : estimated average ranking score $player['s'] (sigma): standard deviation from average I assume I would use some sort of function such as: function calcTrueSkill(&$winner, &$loser) { $winner['m'] = $winner['m'] + (pow($winner['s'],2)/c) * (v*(($winner['m']-$loser['m'])/c,e/c)); $loser['m'] = $loser['m'] - (pow($loser['s'],2)/c) * (v*(($winner['m']-$loser['m'])/c,e/c)); $winner['s'] = sqrt($winner['s'] * (1 - (pow($winner['s'],2)/pow(c,2)) * (w*(($winner['m']-$loser['m'])/c,e/c)))); $loser['s'] = sqrt($loser['s'] * (1 - (pow($loser['s'],2)/pow(c,2)) * (w*(($winner['m']-$loser['m'])/c,e/c)))); c = sqrt((2 * pow(b,2)) + pow($winner['s'],2) + pow($loser['s'],2)); } Unfortunately, as I said before, I am not a mathematician and this stuff confuses me... What is V? What is C? What is E? What is B? Would anyone mind helping me to get this function working? Quote Link to comment https://forums.phpfreaks.com/topic/201578-how-to-program-a-microsoft-trueskill-function-in-php/ Share on other sites More sharing options...
Jaxel Posted May 13, 2010 Author Share Posted May 13, 2010 Oh yes, also forgot... what are those COMMAS in the calculations? And are the brackets [ ] any different from parenthesis ( ) ? Quote Link to comment https://forums.phpfreaks.com/topic/201578-how-to-program-a-microsoft-trueskill-function-in-php/#findComment-1057508 Share on other sites More sharing options...
Daniel0 Posted May 13, 2010 Share Posted May 13, 2010 What is V? v is a function they do not define, but which they've plotted for varying values of ε (epsilon). What is C? c is defined in the image you inserted in your post: [math]c^2 = 2\beta^2+\sigma^2_{winner}+\sigma^2_{loser} \Rightarrow c = \sqrt{2\beta^2+\sigma^2_{winner}+\sigma^2_{loser}}[/math] What is E? ε is what they call a "draw margin" and it depends on the game mode. So it's a constant that is set by you. What is B? β2 (beta) is "the variance of the performance around the skill of each player" as mentioned in the article. Oh yes, also forgot... what are those COMMAS in the calculations? And are the brackets [ ] any different from parenthesis ( ) ? v and w are functions of two variables, so the comma separates the first from the second. Here is another example of a such function: f(x,y) = x+y There is no difference between the square brackets and parentheses here. When you nest parentheses it can sometimes be difficult to read and see where they end, so you might sometimes choose to alternate them. Quote Link to comment https://forums.phpfreaks.com/topic/201578-how-to-program-a-microsoft-trueskill-function-in-php/#findComment-1057589 Share on other sites More sharing options...
Jaxel Posted May 13, 2010 Author Share Posted May 13, 2010 Uhh... alright... maybe that answered my questions... but didn't really help me. function calcTrueSkill(&$win, &$los) { $wM1 = $win['mean']; $wS1 = $win['sdev']; $wM2 = $wM1 * $wM1; $wS2 = $wS1 * $wS1; $lM1 = $los['mean']; $lS1 = $los['sdev']; $lM2 = $lM1 * $lM1; $lS2 = $lS1 * $lS1; $b2 = B * B; $c2 = $b2 + $wS2 + $lS2; $c1 = sqrt($c2); $t1 = ($wM1 - $lM1) / $c1; $wMn = $wM1 + ($wS2 / $c1) * v($t1, e/$c1); $wSn = $lM1 + ($lS2 / $c1) * v($t1, e/$c1); $lMn = sqrt($wS2 * (1 - ($wS2 / $c2) * w($t1, e/$c1))); $lSn = sqrt($lS2 * (1 - ($lS2 / $c2) * w($t1, e/$c1))); $win['mean'] = $WmN; $win['sdev'] = $WsN; $los['mean'] = $LmN; $los['sdev'] = $LsN; } I'm still suck at what I'm supposed to be doing for "v", "w", "B" and "e"... Quote Link to comment https://forums.phpfreaks.com/topic/201578-how-to-program-a-microsoft-trueskill-function-in-php/#findComment-1057769 Share on other sites More sharing options...
duschdas Posted July 22, 2010 Share Posted July 22, 2010 I am also trying to figure out how to implement this in PHP. have you read this article (http://www.moserware.com/2010/03/computing-your-skill.html) about the TrueSkill Algorythm and the coresponding Paper (PDF -> http://dl.dropbox.com/u/1083108/Moserware/Skill/The%20Math%20Behind%20TrueSkill.pdf)? Also still struggling to understand all of it, but still pretty interesting . Maybe this helps a little and you could notify us if you had any success with it. Quote Link to comment https://forums.phpfreaks.com/topic/201578-how-to-program-a-microsoft-trueskill-function-in-php/#findComment-1089666 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.