L.F.
05/11/22
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 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:
The other two vectors \( \mathbf{r} \) and \( \mathbf{y} \) represent respectively:
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
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:
To represent this information in matrix and vector form we have the following representations
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
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]
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
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
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)]
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
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
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
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
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