2017 © Pedro Peláez
 

library fussball-elo

Elo ranking for fussball, with goal difference

image

lsv/fussball-elo

Elo ranking for fussball, with goal difference

  • Monday, December 5, 2016
  • by lsv
  • Repository
  • 2 Watchers
  • 1 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Fussball Elo Ranking – Build Status codecov SensioLabsInsight StyleCI, (*1)

=================, (*2)

Elo ranking calculator, with goal differences, (*3)

Install

composer require lsv/fossball-elo, (*4)

or add it to your composer.json file, (*5)

"require": {
    "lsv/fossball-elo": "^2.0"
}

Usage


$hometeam_oldRating = 200; $awayteam_oldRating = 280; $hometeam_score = 3; $awayteam_score = 2; $factor = 20; // Tournament factor // Normally these are used // 60 - World Cup // 50 - Continental Championship and Intercontinental Tournaments // 40 - World Cup and Continental qualifiers and major tournaments // 30 - All other tournaments // 20 - Friendly Matches use Lsv\FussballElo\Calculator; $calculator = new Calculator(false); // Change false to true if you want to give the hometeam a home advance $ratings = $calculator->getRatings( $hometeam_oldRating, $awayteam_oldRating, $hometeam_score, $awayteam_score, $factor ); // $ratings is now a instance of Lsv\FussballElo\Model\Result $hometeam = $ratings->getHomeTeam(); $awayteam = $ratings->getAwayTeam(); $hometeam->getPointChange(); // Point change in this match for home team $hometeam->getRating(); // New rating for home team $awayteam->getPointChange(); // Point change in this match for away team $awayteam->getRating(); // New rating for away team

Its also possible to only get win expectancies, (*6)

$calculator = new Calculator(false);
// Change false to true if you want to give the hometeam a home advance
$resullt = $calculator->getWinExpectancies($hometeam_oldRating, $awayteam_oldRating);
$hometeam = $result->getHomeTeam();
// $hometeam is now a instance of Lsv\FussballElo\Model\TeamWinExpectancies
$awayteam = $result->getAwayTeam();

$hometeam->getWinExpectancies();
// 0.613
$awayteam->getWinExpectancies();
// 0.387

$hometeam->getWinExpectanciesInPercent(1);
// 1 = Number of digits
// 61.3

$awayteam->getWinExpectanciesInPercent(0);
// 39

Versions

2.*
  • Uses eloratings.net formular
  • Hometeam advantage can be used
1.*
  • Uses elo formular from wikipedia

License

The MIT License (MIT), (*7)

Copyright (c) 2016 Martin Aarhof martin.aarhof@gmail.com, (*8)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:, (*9)

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software., (*10)

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE., (*11)

The Versions

21/11 2016

dev-analysis-87GkY0

dev-analysis-87GkY0

Elo ranking for fussball, with goal difference

  Sources   Download

MIT

The Requires

  • php ^5.6|^7.0

 

The Development Requires