Fundamentals of Statistics contains material of various lectures and courses of H. Lohninger on statistics, data analysis and chemometrics......click here for more.


Matrix Multiplication

The multiplication of two matrices always results in a matrix (this is different to the vector product, which may result either in a scalar or a matrix). The result of matrix multiplication is simply called the matrix product, or (less often) Cayley product. We define as follows:
 
 
Matrix Product Let (ars), (brs), and (crs) be three matrices of order mn, np, and pq respectively. Each element crs of the matrix C, the result of the matrix product A•B is then calculated by the inner product of the s-th row of A with the r-th column of B.

This sounds complicated. But it just means taking one column of one matrix A and one row of (the transposed) matrix B, and calculating the inner product of these two vectors. The following  interactive example  may shed some light on the process of matrix multiplication.
 

The properties of matrix multiplication are interesting: first, one can only multiply matrices of suitable order. The number of rows of the first matrix must be equal to the number of columns of the second one, resulting in a matrix which has the same number of columns as the first matrix, and the same number of rows as the second one.

Secondly, the order of the matrices is quite important: AB is not necessarily equal to BA. In fact, in many cases, the exchange of A and B results in undefined matrix products (the product cannot be calculated); and even for square matrices the commutative law does not hold.

Third, scalars should be looked upon as 11-matrices. When multiplying a 1n-matrix with a n1-matrix (n arbitrary), the result is a 11-matrix (a scalar).

Here are a few rules that hold true for matrix multiplication:
 

  • The associative law: (AB)C = A(BC) for each matrix A, B, and C of suitable order
  • The distributive laws: A(B+C) = AB+AC, and (A+B)C = AC+BC. Note that we need to multiply once "from the right", and once "from the left", since we must not commute the operands of a product!
  • The sticky 0: 0A = A0 = 0 for each A (but we cannot deduce A = 0 or B = 0 (or both) from AB = 0.


In order to make matrix multiplication easier to understand, the matrices can be arranged in a special way. The usual way to denote a matrix multiplication is AB = C (see figure below). However, from this scheme the order of the resulting matrix C is not always clear.

A simple trick helps here: rearrange the two matrices A and B such that these two matrices are located along the sides of a pp square. The size of the rectangle left open by this arrangement depicts the order of the matrix C.