rate_massey(cr_data)
rank_massey(cr_data, keep_rating = FALSE, ties = c("average", "first",
"last", "random", "max", "min"), round_digits = 7)
cr_data | Competition results in format ready for as_longcr(). |
---|---|
keep_rating | Whether to keep rating column in ranking output. |
ties | Value for |
round_digits | Value for |
rate_massey()
returns a tibble with columns
player
(player identifier) and rating_massey
(Massey
rating). The sum of all ratings should be equal to 0.
Bigger value indicates better player performance.
rank_massey()
returns a tibble
with columns player
, rating_massey
(if
keep_rating = TRUE
) and ranking_massey
(Massey ranking
computed with round_rank()
).
This rating method was initially designed for games between two
players. There will be an error if in cr_data
there is a game not between
two players. Convert input competition results manually or with
to_pairgames() from comperes
package.
It is assumed that score is numeric and higher values are better for the player.
Computation is done based only on the games between players of interest (see
Players). Note that all those players should be present in cr_data
because otherwise there will be an error during solving linear system
described below. Message is given if there are players absent in cr_data
.
The outline of Massey rating method is as follows:
Compute Massey matrix: diagonal elements are equal to number of games played by certain player, off-diagonal are equal to minus number of common games played. This matrix will be the matrix of system of linear equations (SLE).
Compute right-hand side of SLE as cumulative score differences of players, i.e. sum of all scores for the player minus sum of all scores against the player.
Make adjustment for solvability of SLE. Modify the last row of Massey matrix so that all its cells are equal to 1. Also change the last cell in right-hand side to 0. This adjustment ensures that sum of all outcome ratings will be 0.
Solve the SLE. The solution is the Massey rating.
comperank
offers a possibility to handle certain set of players. It is done
by having player
column (in longcr format) as factor
with levels specifying all players of interest. In case of factor the result
is returned only for players from its levels. Otherwise - for all present
players.
Kenneth Massey (1997) Statistical models applied to the rating of sports teams. Bachelor’s thesis, Bluefield College.
rate_massey(ncaa2005)#> # A tibble: 5 x 2
#> player rating_massey
#> <chr> <dbl>
#> 1 Duke -24.8
#> 2 Miami 18.2
#> 3 UNC -8.
#> 4 UVA -3.4
#> 5 VT 18
rank_massey(ncaa2005)#> # A tibble: 5 x 2
#> player ranking_massey
#> <chr> <dbl>
#> 1 Duke 5
#> 2 Miami 1
#> 3 UNC 4
#> 4 UVA 3
#> 5 VT 2
rank_massey(ncaa2005, keep_rating = TRUE)#> # A tibble: 5 x 3
#> player rating_massey ranking_massey
#> <chr> <dbl> <dbl>
#> 1 Duke -24.8 5
#> 2 Miami 18.2 1
#> 3 UNC -8. 4
#> 4 UVA -3.4 3
#> 5 VT 18 2