Page 318 - Linear Models for the Prediction of Animal Breeding Values
P. 318
Matrix subtraction follows the same principles used for matrix addition. If B = X − Y,
then b = x − y . Thus the matrix B obtained by subtracting Y from X above is:
ij ij ij
é 40 --(2) 10 - 20ù é 42 -10ù
B= X - Y = ê ú = ê ú ú
-
ë 39 - 4 -25 40 û ë 35 -65 û
A.3.3 Matrix multiplication
Two matrices can be multiplied only if the number of columns in the first matrix
equals the number of rows in the second. The order of the product matrix is equal to
the number of rows of the first matrix by the number of columns in the second. Given
that C = AB, then:
n
m
C = c = å å z a b
ij å ik kj
j = i1 = k1 =1
where m = number of columns in B, n = number of rows in A and z = number of rows
in B. Let:
é 14 - 1ù é 25ù
ê
ú
ê
A = 25 0 ; B = 43 ú ú
ê
ê
ú
ê ë 36 1ú û ê ë 61ú û
Then C can be obtained as:
c = 1(2) + 4(4) + −1(6) = 12 (row 1 of A multiplied by column 1 of B)
11
c = 2(2) + 5(4) + 0(6) = 24 (row 2 of A multiplied by column 1 of B)
21
c = 3(2) + 6(4) + 1(6) = 36 (row 3 of A multiplied by column 1 of B)
31
c = 1(5) + 4(3) + −1(1) = 16 (row 1 of A multiplied by column 2 of B)
12
c = 2(5) + 5(3) + 1(1) = 26 (row 2 of A multiplied by column 2 of B)
22
c = 3(5) + 6(3) + 1(1) = 34 (row 3 of A multiplied by column 2 of B)
23
⎡ 12 16⎤
⎢ ⎥
C = 24 26 ⎥
⎢
⎢ ⎣ 36 34⎥ ⎦
Note that C has order 3 × 2, where 3 equals the number of rows of A and 2 the
number of columns in B. Also, note that AB is not equal to BA, but IA = AI = A, where
I is an identity matrix. If M is the product of a scalar g and a matrix B, then M = b g,
ij
i.e. each element of M equals the corresponding element in B multiplied by g.
A.3.4 Direct product of matrices
Given a matrix G of order n by m and A of order t by s, the direct product is:
ég 11 A g 12 Aù
G Ä A = ê ú
ë g 21 A g 22 A û
302 Appendix A