Appendix B Matrix Algebra
Appendix B Matrix Algebra
Shaojian Chen
September 23, 2021
1 Basic Definitions
Definition 1.1 (Matrix). A matrix is a rectangular array of numbers. More precisely,
an m n matrix has m rows and n columns. The positive integer m is called the row
dimension, and n is called the column dimension.
where aij represents the element in the ith row and the jth column. For example, a25
stands for the number in the second row and the fifth column of A. A specific example
of a 2 3 matrix is
2 −1 7
Α=
0
(A.1)
−4 5
Where a13 = 7 . The shorthand A = [aij ] is often used to define matrix operations.
Definition 1.2 (Square Matrix). A square matrix has the same number of rows and
columns. The dimension of a square matrix is its number of rows and columns.
(i)A 1 m matrix is called a row vector (of dimension m) and can be written as
x ( x1 , x2 , , xm ) .
1 / 11
x1
x
x 2
xn
Definition 1.4 (Diagonal Matrix).A square matrix A is a diagonal matrix when all of its
off-diagonal elements are zero, that is, aij = 0 for all i j . We can always write a diagonal
matrix as
a11 0 0 0
0 a22 0 0
Α=
0 0 0 ann
(ii) The m n zero matrix, denoted 0, is the m n matrix with zero for all entries. This
need not be a square matrix.
2 Matrix Operations
2.1 Matrix Addition
Two matrices A and B, each having dimension m n , can be added element by element:
A + B = [ aij + bij ] . More precisely,
For example,
2 −1 7 1 0 −4 3 −1 3
−4 + =
5 0 4 2 3 0 7 3
2 / 11
Matrices of different dimensions cannot be added.
Given any real number g (often called a scalar), scalar multiplication is defined as
A [ aij ] , or
a11 a12 a1n
a a22 a2 n
Α = 21
am1 am 2 amn
To multiply matrix A by matrix B to form the product AB, the column dimension of A
must equal the row dimension of B. Therefore, let A be an m n matrix and let B be an
n p matrix. Then, matrix multiplication is defined as
n
ΑΒ = aik bkj
k =1
In other words, the (i, j)th element of the new matrix AB is obtained by multiplying each
element in the ith row of A by the corresponding element in the jth column of B and
adding these n products together.
For example,
0 1 6 0
2 −1 0 1 −1
1 =
0 12
−4 −1
0 1
2 0
−1 −2 −24
0
1
3 0 0
3 / 11
appropriate dimensions for applying each operation, and and are real numbers.
Most of these properties are easy to illustrate from the definitions.
2.4 Transpose
For example,
2 −4
2 −1 7
A= , A = −1 5
−4 5 0
7 0
Properties of Transpose. (1) (A) = A ; (2) ( A) = A for any scalar ; (3)
(A + B) = A + B ; (4) (AB) = BA , where A is m n and B is n k ; (5) xx =
n 2
x ,
i =1 i
a1
a
A = 2
a n
then A = (a1 , a 2 , , a n ) .
4 / 11
Definition 2.2 (Symmetric Matrix). A square matrix A is a symmetric matrix if, and
only if, A = A .
If X is any n k matrix, then XX is always defined and is a symmetric matrix, as can be
seen by applying the first and fourth transpose properties.
Let A be an n k matrix with rows given by the 1 k vectors a1, a2, , an, and let B be
an n m matrix with rows given by 1 m vectors b1, b2, , bn:
a1 b1
a b
A= 2
, B=
2
a n b n
Then,
n
AB = aibi
i=1
where for each i , ai b i is a k m matrix. Therefore, AB can be written as the sum of n
matrices, each of which is k m . As a special case, we have
n
AA = aiai
i=1
A more general form of partitioned matrix multiplication holds when we have matrices
A ( m n ) and B ( n p ) written as
When we form the product AB, the expression looks just when the entries are scalars:
5 / 11
Note that each of the matrix multiplications that form the partition on the right is well
defined because the column and row dimensions are compatible for multiplication.
2.6 Trace
The trace of a matrix is a very simple operation defined only for square matrices.
Definition 2.3 (Trace). For any n n matrix A, the trace of a matrix A, denoted tr(A), is
the sum of its diagonal elements. Mathematically,
n
tr( A) = aii
i =1
Properties of Trace. (1) tr(I n ) = n ; (2) tr(A + B) = tr(A) + tr(B) ; (3) tr(A) = tr(A) ; (4)
tr( A) = tr(A) , for any scalar ; and (5) tr(AB) = tr(BA) , where A is m n and B is
n m .
2.7 Inverse
If A is n m , its rank can be at most m. A matrix has full column rank if its columns form
a linearly independent set. For example, the 3 2 matrix
1 3
2 6
0 0
can have at most rank two. In fact, its rank is only one because the second column is
three times the first column.
7 / 11
then XX and XX are p.s.d.; and (4) If X is n k and rank(X) = k , then XX is p.d. (and
therefore nonsingular).
5 Idempotent Matrices
Definition 5.1 (Idempotent Matrix). Let A be an n n symmetric matrix. Then A is said
to be an idempotent matrix if, and only if, AA = A .
For example,
1 0 0
0 0 0
0 0 1
(i)If x is an n 1 random vector, the expected value of x, denoted E(x), is the vector of
expected values: E(x)=[E(x1 ), E(x2 ),..., E(xn )] .
10 / 11
7.5 t Distribution
7.6 F Distribution
11 / 11