Next Page Previous Page Home Tools & Aids Search Handbook
6. Process or Product Monitoring and Control
6.5. Tutorials

6.5.3.

Elements of Matrix Algebra

Elementary Matrix Algebra
Basic definitions and operations of matrix algebra - needed for multivariate analysis Vectors and matrices are arrays of numbers. The algebra for symbolic operations on them is different from the algebra for operations on scalars, or single numbers. For example there is no division in matrix algebra, although there is an operation called "multiplying by an inverse". It is possible to express the exact equivalent of matrix algebra equations in terms of scalar algebra expressions, but the results look rather messy.

It can be said that the matrix algebra notation is shorthand for the corresponding scalar longhand.

Vectors A vector is a column of numbers
a = [a1 a2 ... ap]

The scalars ai are the elements of vector a.

Transpose The transpose of a, denoted by a', is the row arrangement of the elements of a.
a' = [a1 a2 ... ap]
Sum of two vectors The sum of two vectors (say, a and b) is the vector of sums of corresponding elements.
a + b = [a1+b1   a2+b2   ....   ap+bp
The difference of two vectors is the vector of differences of corresponding elements.
Product of a'b The product a'b is a scalar formed by
a'b = [a1*b1 + a2*b2 + ... + ap*bp]
which may be written in shortcut notation as
c = SUM[i=1 to p][a(i)*b(i)]
where ai and bi are the ith elements of vector a and b, respectively.
Product of ab' The product ab' is a square matrix
ab' =
 [a1*b1   a1*b2   ...   a1*bp;
  a2*b1   a2*b2   ...  a2*bp;
              ....          ;
  ap*b1   ap*b2   ...  ap*bp]
Product of scalar times a vector The product of a scalar k, times a vector a is k times each element of a
k*a = a*k = [k*a1   k*a2   ...   k*ap]
A matrix is a rectangular table of numbers A matrix is a rectangular table of numbers, with p rows and n columns. It is also referred to as an array of n column vectors of length p. Thus
A =
 [a11   a12   ...   a1n;
  a21   a22   ...   a2n;
          ....         ;
  ap1   ap2   ...   apn]
is a p by n matrix. The typical element of A is aij, denoting the element of row i and column j.
Matrix addition and subtraction Matrices are added and subtracted on an element-by-element basis. Thus
A + B =
 [a11+b11   a12+b12   ...   a1n+b1n;
  a21+b21   a22+b22   ...   a2n+b2n;
                  ....             ;
  ap1+bp1   ap2+bp2   ...   apn+bpn]
Matrix multiplication Matrix multiplication involves the computation of the sum of the products of elements from a row of the first matrix (the premultiplier on the left) and a column of the second matrix (the postmultiplier on the right). This sum of products is computed for every combination of rows and columns. For example, if A is a 2 x 3 matrix and B is a 3 x 2 matrix, the product AB is
A*B =
[a11*b11+a12*b21+a13*b31   a11*b12+a12*b22+a13*b32;
 a21*b11+a22*b21+a23*b31   a21*b12+a22*b22+a23*b32]
Thus, the product is a 2 x 2 matrix. This came about as follows: The number of columns of A must be equal to the number of rows of B. In this case this is 3. If they are not equal, multiplication is impossible. If they are equal, then the number of rows of the product AB is equal to the number of rows of A and the number of columns is equal to the number of columns of B.
Example of 3x2 matrix multiplied by a 2x3 It follows that the result of the product BA is a 3 x 3 matrix

B*A =
[b11*a11+b12*a21   b11*a12+b12*a22   b11*a13+b12*a23;
 b21*a11+b22*a21   b21*a12+b22*a22   b21*a13+b22*a23;
 b31*a11+b32*a21   b31*a12+b32*a22   b31*a13+b32*a23]

General case for matrix multiplication In general, if A is a k x p matrix and B is a p x n matrix, the product AB is a k x n matrix. If k = n, then the product BA can also be formed. We say that matrices conform for the operations of addition, subtraction or multiplication when their respective orders (numbers of row and columns) are such as to permit the operations. Matrices that do not conform for addition or subtraction cannot be added or subtracted. Matrices that do not conform for multiplication cannot be multiplied.
Home Tools & Aids Search Handbook Previous Page Next Page