Sports Ranking Using the Massey Method

L.F.
05/11/22

Introduction

The following presentation will focus on the application of linear algebra and matrices in the field of sports ranking. The emphasis of the project is on the use of the Massey Method developed by Kenneth Massey in 1997 (Langville and Meyer).

  • The Massey method looks at a system of \( n \) number of teams and the point difference of the games played against those teams
  • The method looks to solve the Matrix Equation \[ X\mathbf{r} = \mathbf{y} \] where \( \mathbf{r} \) is the vector we solve for representing the ranking of the teams
  • Methods used to solve this equation follow from Ch7.3 in the book, Gauss-Jordan elimination

Description of Method

The Massey method sets a matrix, \( X \), with \( n \) number of columns representing the teams in the observed system, and \( m \) number of rows representing the games played. The entries of the matrix represent the wins and losses of each game:

  • A -1 is entered in the corresponding \( X_{(m,n)} \) position if a team loses
  • A 1 is entered in the corresponding \( X_{(m,n)} \) position if a team wins
  • A 0 is entered in all others potions indicating a game wasn't played

Description of Method

The other two vectors \( \mathbf{r} \) and \( \mathbf{y} \) represent respectively:

  • The ratings of the teams which we solve for
  • The point difference of each corresponding game

It so happens that \( X \) is inconsistent, so the response developed by Massey is to multiply \( X\mathbf{b} = \mathbf{y} \) by the transpose of \( X \), \( X^{T} \). The resulting matrix has infinetly many solutions, so in order to find a single solution for the ranking the last row of the resulting matrix is replaced with 1's. The resulting equation is denoted as follows \[ A\mathbf{r} = \mathbf{b} \] The system is then solved by using Gauss-Jordan elimination and back substitution

Example of a Ranking

The following is an example of code relative to the methods we have discussed in class. Imagine that we are looking in a sporting division with three teams present, and the games between them are as follows:

  • Team 1 beats team 2 by 20 points
  • Team 2 beats team 3 by 7 points
  • Team 1 beat team 3 by 2 points

To represent this information in matrix and vector form we have the following representations

Octave Code

disp("Create matrix X with the 1, -1, and 0 entries in the corresponding positions")
X = [1,-1,0;0,1,-1;1,0,-1]

disp("Create the point difference vector y")
y = [20;7;2]

disp("Find the transpose matrix of X using command found in the fourth source")
Xt = X';

disp("Use Matrix multiplication to multiply Xt to X to create A and to y to create b")
A = Xt*X;
b = Xt*y;

A
b

Octave Code Part 2

disp("And Now make the last row entries of matrix A 1")
[m,n] = size(A);

for p = m
 for s = 1:n
  row_3 = p;
  A(p,s) = 1;
 end
end

A

disp("Now Use Gauss Jordan on the Augmented matrix A and b")
C = [2,-1,-1,22;-1,2,-1,-13;1,1,1,-9]

Octave Code Part 3

disp("Use Gauss elimination to put C into upper triangular form:")
[M,N] = size(C);
m = 0;
for j = 1:N
 for i = j+1:M
  for n = i
   m = C(n,j)/C(j,j); 
   column_number = j
   row_number = i
   n = n;
   m = m
   C(n,:) = C(n,:) - m*C(j,:)
   end
  end
end

Octave Code Part 4

disp("Use Gauss-Jordan elimination to put C into diagonal form:")
m = 0;
for j = j-1:-1:1
 for i = j-1:-1:1
  for n = i
   m = C(n,j)/C(j,j); 
   column_number = j
   row_number = i
   n = n;
   m = m
   C(n,:) = C(n,:) - m*C(j,:)
   end
  end
end

Octave Code Part 5

disp("Divide rows of C by corresponding diaganal entries to get rref:")
for i = 1:M
 for j = 1:N
   C(i,:) = C(i,:)/C(i,i);
 end
end
C

disp("To solve, the entries of r are found in the last column of C:")
r = [C(:,N)]

Octave Output

Create matrix X with the 1, -1, and 0 entries in the corresponding positions
X =

   1  -1   0
   0   1  -1
   1   0  -1

Create the point difference vector y
y =

   20
    7
    2

Octave Output Part 2

Find the transpose matrix of X using command found in the fourth source
Use Matrix multiplication to multiply Xt to X to create A and to y to create b
A =

   2  -1  -1
  -1   2  -1
  -1  -1   2

b =

   22
  -13
   -9

Octave Output Part 3

And Now make the last row entries of matrix A 1
A =

   2  -1  -1
  -1   2  -1
   1   1   1

Now Use Gauss Jordan on the Augmented matrix A and b, C
C =

    2   -1   -1   22
   -1    2   -1  -13
    1    1    1   -9

Octave Output Part 4

Use Gauss elimination to put C into upper triangular form:
C =

    2.0000   -1.0000   -1.0000   22.0000
         0    1.5000   -1.5000   -2.0000
         0         0    3.0000  -18.0000

Use Gauss-Jordan elimination to put C into diagonal form:
C =

    2.0000         0         0    8.6667
         0    1.5000         0  -11.0000
         0         0    3.0000  -18.0000

Octave Output Part 5

Divide rows of C by corresponding diaganal entries to get rref:
C =

   1.0000        0        0   4.3333
        0   1.0000        0  -7.3333
        0        0   1.0000  -6.0000

To solve, the entries of r are found in the last column of C:
r =

   4.3333
  -7.3333
  -6.0000

Discussion of Results

  • Based on the Massey method of sports ranking, in this particular scenario, team 1 would've been ranked in the top spot, team 3 would be in second place, and team 2 is at the bottom of the ranking. The Massey method can be used on systems much larger than the one shown above.
  • It can be seen that the methods we've talked about in class, such as Gauss-Jordan elimination and iteration methods, are applicable to the topic of sports ranking

References