Matrix Algebra
Matrix Algebra
Lectures 1-6
MATRIX ALGEBRA
Charles Nadeau
E-mail: [email protected]
Office: E-506
Office Hours: by appointment
Autumn 2023
Modeling Systems in Matrix Form
Simple linear input-output model:
x1 – βx2 = d1
x2 – γx3 = d2
x3 - αx1 = 0
where (x1 , x2 , x3) denote endogeneous variables, (β, γ, α) denote coefficients and (d1 , d2) denote
constant terms.
Matrix form: Ax = d
where
1 −β 0 x1 d1
A = 0 1 −γ x = x2 d = d2
−α 0 1 x3 0
vector ≡ special matrix with only 1 row or 1 column (row vector, column vector)
Note: If the coefficient matrix (A) is a non-singular, square matrix then the model can be
solved (x1*, x2*, x3*, ….) and the solution set will be unique.
Modeling Systems in Matrix Form (cont)
A = x = d =
Modeling Systems in Matrix Form (cont)
Suppose:
2x1 - x2 = 0
-x1 + x2 = 4
Matrix form:
Ax = d
where
2 −1 x1 0
A = x = d =
−1 1 x2 4
x1
First equation: [2 -1] = 0
x2
x1
Second equation: [-1 1] = 4
x2
Vectors
Vectors are ordered arrays of elements (e.g. numbers, variables, ect …):
Two-dimensional vectors:
x´ = [x1 x2]
y1
y = y
2
Three-dimensional vectors:
x´ = [x1 x2 x3]
y =
n-dimensional vectors:
x´ = [x1 x2 x3 … xn]
y =
m x n matrix:
Amn =
where aij denotes the element of the matrix on the intersection of row i and
column j, considered as a single entity (e.g. number, parameter, variable).
Special matrices:
Identity matrix:
1 0
I2 =
0 1
I3 =
Special matrices:
Null matrix:
0 0
022 =
0 0
032 =
Addition/Subtraction:
Vectors must have the same dimension
Multiplication:
Column dimension of the lead vector must be same as the row dimension of lag vector
(e.g. 1x2 lead vector and 2x1 lag vector)
Division:
Impossible
Vector Addition and Subtraction
Suppose:
x´ = [8 9 -3]
z´ = [4 -5 6]
Then:
x´ + z´ = [12 4 3]
x´ - z´ = [4 14 -9]
Suppose:
−2
y = 7
−1
0
z = 13
4
Then:
−2 −2
y + z = 20 and y - z = −6
3 −5
Vector Addition and Subtraction (cont)
Generically:
x´ = [x1 x2 x3]
z´ = [z1 z2 z3]
x´ + z´ = [x1 + z1 x2 + z2 x3 + z3]
x´ - z´ = [x1 - z1 x2 - z2 x3 - z3]
y1 z1
y = y2 z = z2
y3 z3
y1 + z1 y1 − z1
y + z = y2 + z2 y - z = y2 − z2
y3 + z3 y3 − z3
Scalar Multiplication (α)
Suppose:
x´ = [x1 x2 x3]
y =
Then:
αy =
Vector Multiplication (cont)
Generically:
x´ = [x1 x2 x3]
y =
Then:
A system of vectors (x, y, z) is linearly dependent if some non-trivial linear combination of them is
equal to the null vector:
α1x + α2y + α3z = 0
where the scalars (α1 , α2 , α3) are not all equal to zero.
Examples:
(1) Two vectors (x, y) are linearly dependent if they are proportional: x = αy
(2) Three vectors (x, y, z) are linearly dependent if one of the vectors is a linear combination of the
other two vectors: z = α1x + α2y
Example:
v1´ = [5 12] v2´ = [10 24]
2v1´ = v2´
2v1´ - v2´ = 0
Example:
2 1 4
v1 = v2 = v3 =
7 8 5
3v1 – 2v2 = v3
3v1 – 2v2 – v3 = 0
Multiplication:
Column dimension of the lead matrix must be the same as the row dimension of lag matrix
Associative Law: (AB)C = A(BC) = ABC
Distributive Law: A(B + C) = AB + AC
Division:
Impossible
Matrix Addition
Rules:
(1) Commutative: A + B = B + A
(2) Associative: (A + B) + C = A + (B + C)
(3) Null matrix (0): A + 0 = A
(4) Opposite matrix (-A): A + (-A) = 0
Matrix Addition/Subtraction
Example:
4 9 2 0
A = B =
2 1 0 7
6 9
A+B =
2 8
Example:
19 3 6 8
A = B =
2 0 1 3
13 −5
A-B =
1 −3
Scalar Multiplication
αa11 αa12
αA =
αa21 αa22
Rules:
(1) α1(α2 A) = (α1 α2) A
(2) α (A + B) = αA + αB
(3) (α1 + α2) A = α1 A + α2 A
Matrix Multiplication
Conformability Requirement:
Amk Bkn = Cmn
(column dimension of lead matrix) = (row dimension of lag matrix) = k
Dimension of product matrix: (m x n)
Multiplication Rule:
cij = σ𝑘𝑝=1(𝑎ip)(𝑏pj )
(cij is calculated as the inner product of the ith row of A and the jth column of B)
Result: scalar
Suppose:
1 2 3
A = 4 5 6
7 8 9
Then:
1 4 7
A´ = 2 5 8
3 6 9
Properties: (A´)´ = A
(A + B)´ = A´ + B´
(AB)´ = B´A´
Transpose of a Matrix (cont)
Suppose:
1 2 3 4
A =
5 6 7 8
Then:
A´ =
Matrix Inversion
A-1
and is defined such that
AA-1 = A-1 A = I
Note: (1) unlike a transpose matrix, an inverse matrix may not exist.
(2) if square matrix A has an inverse, then A is called nonsingular.
(3) if square matrix A has no inverse, then A is called singular.
(4) A and A-1 will always have the same dimension.
(5) if A-1 exists, then it is unique.
Properties:
(A-1)-1 = A
(AB)-1 = B-1 A-1
(A´)-1 = (A-1)´
Determinant of a Matrix
Suppose:
a11 a12
A =
a21 a22
Then:
a11 a12
A ≡ det A = = (a11a22 - a12a21) (scalar)
a21 a22
where the value of A is a crucial test for the singularity of the matrix (discussed earlier)
and is useful for calculating A-1 (also discussed earlier).
Determinant of a Matrix (cont)
Suppose:
a11 a12 a13
A = a21 a22 a23
a31 a32 a33
Then:
a22 a23 a a23 a a
A = a11 - a12 21 + a13 21 22
a32 a33 a31 a33 a31 a32
where the subdeterminant Mij denotes the minor of element aij. The cofactor ( Cij ) of
element aij is defined as:
Note: In the example above, A was calculated via expansion along the first row …
Determinant of a Matrix (cont)
The value of the determinant of a matrix can be calculated by expansion using any row i
or column j in the matrix; thus, the formula for the value of the determinant of matrix A
can be written as either:
Properties:
A = 0
(2) A = A′
(3) If matrix A has a 0 row or column, then A = 0
(4) Interchanging rows (or columns) in matrix A does not affect A
(5) Multiplying 1 row/column in matrix A by scalar α yields: α A
Given:
2 0
A =
0 2
Calculating:
𝐴 = (2)(2) – (0)(0) = +4
Given:
−1 5
A =
2 −10
Calculating:
𝐴 = (-1)(-10) – (5)(2) = 0
Suppose:
A =
B =
Calculating:
adj A
A-1 = A
Constructing a Cofactor Matrix
To construct a cofactor matrix (C) for matrix A we simply replace each element in matrix A
(aij) with its cofactor ( Cij ), where
Example:
a11 a12
A =
a21 a22
a22 −a12
adj A ≡ C´ =
−a21 a11
Constructing a Cofactor Matrix (cont)
Example:
a11 a12 a13
A = a21 a22 a23
a31 a32 a33
C =
adjA ≡ C´ =
Calculating the Inverse of a Matrix (cont)
Example:
1 0 0
I = 0 1 0
0 0 1
1 0 0 1 0 0
C = 0 1 0 → adj I = 0 1 0
0 0 1 0 0 1
1 0 0
adj I
Thus: I-1 = I
= 0 1 0
0 0 1
Suppose:
Ax = d
where the coefficient matrix A is an nxn square matrix and d is an nx1 column vector
where d ≠ 0. If A ≠ 0 (i.e. matrix A is non-singular and thus full rank) then A-1 exists and
the unique solution to the system is:
x* = A-1 d
Solutions of a Square System
Suppose:
Ax = d
where the coefficient matrix A is an nxn square matrix (i.e. Ax = d denotes a square
system with n-equations and n-unknown variables).
Suppose:
Ax = d
where the coefficient matrix A is an mxn non-square matrix (i.e. Ax = d denotes a non-
square system with m-equations and n-unknown variables).
Given:
Ax = d
x* = A-1 d
where Aj denotes the matrix A with the jth column replaced by the column vector d.