Professional Documents
Culture Documents
and Probability
YU SHENG LOH
Matrix Algebra
What is a Matrix
A matrix is an array of values that is contained within rows and columns
Horizontal ‘rows’ and vertical ‘columns’
A matrix with 𝑚 rows and 𝑛 columns is an 𝑚 x 𝑛 matrix
Subtraction
𝑎 𝑏 𝑒 𝑓 𝑎−𝑒 𝑏−𝑓
− =
𝑐 𝑑 𝑔 ℎ 𝑐−𝑔 𝑑−ℎ
Multiplication of Matrices
By a scalar
𝑎 𝑏 2𝑎 2𝑏
2∗ =
𝑐 𝑑 2𝑐 2𝑑
Nb ligne 1 Nb Column 2
Verification
𝑎 𝑏 1 0 𝑎∗1+𝑏∗0 𝑎∗0+𝑏∗1
=
𝑐 𝑑 0 1 𝑐∗1+𝑑∗0 𝑐∗0+𝑑∗1
𝑎 𝑏
=
𝑐 𝑑
Determinant and Inverse of 2x2 Matrix
For a matrix 𝑨 = 𝑎 𝑏 , its determinant 𝑨 = 𝑎𝑑 − 𝑏𝑐
𝑐 𝑑
If the determinant is non-zero, then its inverse exists. Otherwise it is a singular matrix
%&!'( )
" 𝑎 𝑏 𝑑 −𝑏 %&!'( %&!'(
= = ) %&!'(
%&!'( 𝑐 𝑑 −𝑐 𝑎
%&!'( %&!'(
" 𝑎𝑑 − 𝑏𝑐 −𝑎𝑏 + 𝑏𝑎 1 0
= %&!'( =
𝑐𝑑 − 𝑑𝑐 −𝑐𝑏 + 𝑑𝑎 0 1
" 𝑎𝑑 − 𝑏𝑐 𝑎𝑏 − 𝑎𝑏
= =𝑰
%&!'( 𝑐𝑑 − 𝑐𝑑 𝑎𝑑 − 𝑏𝑐
Transpose
𝑎"" 𝑎"* 𝑎"+
For matrix 𝑨 = 𝑎*" 𝑎** 𝑎*+
𝑎+" 𝑎+* 𝑎++
In a transposed matrix, the original rows become columns and columns become rows
3x3 Matrix
𝑎"" 𝑎"* 𝑎"+
For matrix 𝑨 = 𝑎*" 𝑎** 𝑎*+
𝑎+" 𝑎+* 𝑎++
Its determinant 𝑨 = 𝑎"" 𝑎** 𝑎++ + 𝑎"* 𝑎*+ 𝑎+" + 𝑎"+ 𝑎*" 𝑎+* − 𝑎"" 𝑎*+ 𝑎+* − 𝑎"* 𝑎*" 𝑎++ − 𝑎"+ 𝑎** 𝑎+"
"
𝑨!" = 𝑪,
|𝑨|
Inverse of 3x3 Matrix Using Gaussian
Elimination
1 0 1
Linear row reduction of 2 1 1
0 1 3
Start with
1 0 11 0 0
2 1 10 1 0
0 1 30 0 1
𝑣"
Where 𝒗 = 𝑣 is the eigenvector of matrix 𝑨 and 𝜆 is its associated eigenvalue, which is a scalar
*
In order to solve for the eigenvalues and eigenvectors we use the following relationship
𝑨 − 𝜆𝑰 = 0
Eigen Decomposition
Example: 𝑨 = 2 1
1 2
2 1 1 0
− 𝜆 =0
1 2 0 1
2−𝜆 1
=0
1 2−𝜆
(2 − 𝜆)* −1 = 0
𝜆* − 4𝜆 + 3 = 0
𝜆−3 𝜆−1 =0
𝜆 = 1 𝑜𝑟 3
Eigen Decomposition
Next, we find 𝒗
𝑨 − 𝝀𝑰 𝒗 = 𝟎
2 1 1 0
𝑨 − 𝝀𝑰 = −𝜆
1 2 0 1
2−𝜆 1
=
1 2−𝜆
For 𝜆 = 1 For 𝜆 = 3
1 1 −1 1 1 1
𝑨 − 𝝀𝑰 = 𝑨 − 𝝀𝑰 = 𝒗!"# = , 𝒗!"$ =
1 1 1 −1 −1 1
𝑣# + 𝑣% = 0 𝑣# − 𝑣% = 0
Setting 𝑣# = 1, 𝑣% = −1 Setting 𝑣# = 1, 𝑣% = 1
Example in Finance
Optimisation of portfolio
Portfolio return
𝜇)
𝑤) 𝑤* 𝑤+ ' 𝜇* = 𝜇,
𝜇+
Portfolio variance
𝜎)" 𝜎)* 𝜎)+ 𝑤)
𝑤) 𝑤* 𝑤+ 𝜎)* 𝜎*" 𝜎*+ 𝑤* = 𝜎,"
𝜎)+ 𝜎*+ 𝜎+" 𝑤+
Subject to 𝒘- 𝟏 = 1
Practice Questions
1 3
6 2 3
1. Find the solution to 4 1
1 4 2
2 7
2 1 2
2. Find the inverse of 1 2 1
3 2 0
3 2
3. Find the eigenvalues and eigenvectors of
1 2