You are on page 1of 39

Quantitative Methods for Finance

Lecture 1: Linear Algebra

Nicolosi/Ramponi

A.A. 2022/2023

Corporate Finance - LUISS University

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Outline

1 Matrices and Vectors


2 Determinant and rank
3 Systems of linear equations

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Matrices and vectors

A matrix may be defined as a rectangular array of numbers (real


or complex): when the array A has m rows and n columns and the
entries are real numbers, we say that A is an m × n matrix, or
more formally A ∈ Rm×n .
The elements of A are denoted as aij , where i denotes the row and
j the column:
 
a11 a12 · · · a1n
 a21 a22 · · · a2n 
A= .
 
. .. .. .. 
 . . . . 
am1 am2 · · · amn

If m = 1, A is a row vector; if n = 1, A is a column vector.


Sometimes a m × n matrix is expressed as A = (aij )m×n

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Matrices and vectors

Example 1
You may think of a m × n matrix A as a portion of a spreadsheet
containing in each cell (the entry aij ) a number: suppose for
example to have m = 3 industries producing n = 4 products and
let aij be the monthly number of items put on the market. We may
organize this information into a 3 × 4 matrix:
 
1000 246 2380 1760
A =  1530 432 2140 1820 
1345 563 1990 2110

We have e.g. a32 = 563, a14 = 1760....

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Matrices and vectors

Example 2
Let us consider a system of linear equations:
 √
3x1 − x2 + 2x3 = 2
0.2x1 + 2x2 − 5.6x3 = 0

Here the coefficients of the system may be organized into a 2 × 3


matrix and a 2 × 1 vector:
 √   
3 −1 2 2
,
0.2 2 −5.6 0
 
x1
Also the unknowns may be represented as the vector  x2 .
x3

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Matrix Operations

In general, if A = (aij )m×n and B = (bij )m×n are two matrices of


the same dimension, we define the sum of A and B as the matrix
obtained by adding their corresponding entries:

A + B = (aij )m×n + (bij )m×n := (aij + bij )m×n

Of course the same is true for the subtraction.


Example 3
     
3 −1 1 4 4 3
+ =
5 2 0 −3 5 −1

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Matrix Operations

If α ∈ R, we define the multiplication by a scalar αA as

αA := (αaij )m×n

Example 4
   
3 −1 6 −2
2 =
5 2 10 4

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Matrix Operations

Let A, B and C matrices with dimension m × n.


Rules for matrix addition and multiplication by scalars
(A + B) + C = A + (B + C )
A+B =B +A
A+0=A
(α + β)A = αA + βA
α(A + B) = αA + αB
where 0 is the zero matrix of dimension m × n consisting only of
zeros.

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Matrix Multiplication

Let A = (aij )m×n and B = (bij )n×p be two matrices. The matrix
product C = AB is defined as the m × p matrix C = (cij )m×p
whose entries are
n
X
cij := aik bkj = ai1 b1j + ai2 b2j + . . . + ain bnj
k=1

Sometimes this is called the row-by-column product.


Example 5


  1 2  
3 −1 0 3 5
A= , B=  0 1  ⇒ AB =
2 1 −5 −3 −5
1 2

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Matrix Multiplication

Assume that A, B and C are matrices for which the multiplication


is well-defined:
Rules for matrix multiplication
(AB)C = A(BC )
A(B + C ) = AB + AC
(A + B)C = AC + BC
(αA)B = A(αB) = α(AB)

Remark 1
The matrix multiplication is NOT commutative: in general
AB 6= BA.

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Matrix Multiplication

Example 6 (Systems of equations in matrix form)


Let us consider the system
 √
 3x1 − x2 + 2x3 = 2
0.2x1 + 2x2 − 5.6x3 = 0
−x1 + 4x2 − 0.1x3 = 1/2

It can be written as
Ax = b
where
 √     
3 −1 2 2 x1
A =  0.2 2 −5.6  , b =  0  , x =  x2  .
−1 4 −0.1 1/2 x3

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


The Identity matrix

The identity matrix of order n, denoted with In , is the matrix


whose entries are
 
1 0 ··· 0
 0 1 ··· 0 
In =  . . .
 
 .. .. . . ... 

0 0 ··· 1

It is immediately seen that for any n × n matrix A

AIn = In A = A.

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


The Transpose matrix

Let A be a m × n matrix, A = (aij )m×n . The transpose of A,


denoted by A0 (or At ) is defined as A0 = (aji )n×m , that is the rows
of A become the columns of A0 :
   
a11 a12 · · · a1n a11 a21 · · · am1
 a21 a22 · · · a2n   a12 a22 · · · am2 
0
A= . ..  ⇒ A =  ..
   
. .. .. .. .. .. 
 . . . .   . . . . 
am1 am2 · · · amn a1n a2n · · · amn

Example 7
 
  3 0
3 1 5
A= ⇒ A0 =  1 −1 
0 −1 2
5 2

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


The Transpose matrix
Rules for matrix transposition
(A0 )0 = A
(A + B)0 = A0 + B 0
(αA)0 = αA0
(AB)0 = B 0 A0

The n × n matrix A is said symmetric if and only if A = A0 , that


is aij = aji for all i, j = 1, 2, . . . , n.
Example 8 (Symmetric matrices)
 
  4 3 1 2
  1 2 −1
3 1  2 0 4 ,
 3 0 5 6 
,  
1 2  1 5 0 7 
−1 4 3
2 6 7 0

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Vectors

A matrix for which m = 1 or n = 1 is called a column or row


vector, respectivley: so
 
a1
 a2 
a = (a1 , a2 , . . . , an ) (row vector), a =  .  , (column vector)
 
.
 . 
an

The number ai is called the i-th component (or coordinate) of


the vector. Of course row and column vectors contain the same
‘’information”, but the dimension 1 × n or n × 1 is important for
matrix operations and coding.
Geometrically, a vector of real numbers represents a point in the n-
dimensional space Rn .

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Operations on vectors

Since n-vectors are matrices with a dimension fixed to 1, all the


algebraic operations defined for matrices are equally valid for
n-vectors, provided the right dimensions:
sum and difference: a + b, a − b
multiplication by a scalar α: αa
product: if a is 1 × n and b = n × 1, then ab is 1 × 1 (a
scalar). If a is n × 1 and b = 1 × n, then ab is n × n (a
matrix).

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Operations on vectors
Example 9

         
−1 −2 −1 2 1
2 = + =
3 6 3 1 4

Example 10

     
 1 2  2 6
2 1 =5 1 3 =
3 1 1 3

Example 11
    
2 1 1 5
=
1 0 3 1
Nicolosi/Ramponi QMF (a-b) - A.A. 22/23
Operations on vectors

Given two vectors a, b having the same dimension and two scalars
α, β, the vector αa + βb is defined to be a linear combination of
a and b:
     
a1 b1 αa1 + βb1
 a2   b2   αa2 + βb2 
α .  + β .  =  .
     
. . ..
 .   .   . 
an bn αan + βbn

Of course, linear combinations may be generalized to any finite


number m of vectors.

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Operations on vectors

A linear combination of m be vectors v1 , v2 , . . . , vm is a vector

α1 v1 + α2 v2 + · · · + αm vm

where αi ∈ R, i = 1, 2, . . . , m.
Example 12
Let v1 = (1, −2), v2 = (−1, 0) and v3 = (1, 1) vectors in R2 , and
α1 = 3, α2 = −2, α3 = 1: then
       
1 −1 1 6
3 −2 +1 =
−2 0 1 −5

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Operations on vectors

Example 13
Let us consider a portfolio composed by 3 assets. Let a1 = 4,
a2 = 2, a3 = 1, be the number of shares of the assets and
p1 = 100, p2 = 80, p3 = 120 the corresponding market value. Then
the value V of the portfolio is clearly
3
X
V = a1 p1 + a2 p2 + a3 p3 = ai pi = 4 × 100 + 2 × 80 + 1 × 120.
i=1

We may represent this quantity as a matrix product: let


a0 = (a1 , a2 , a3 ) and p0 = (p1 , p2 , p3 ) be 3-dimensional vectors,
then  
100
V = a0 p = 4 2 1  80  .


120

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


The inner product

The inner (or scalar) product of two n-vectors a and b is defined


as
n
X
a · b = a1 b1 + a2 b2 + · · · + an bn = ai bi
i=1

Rules for the inner product


a·b=b·a
a · (b + c) = a · b + a · c
(αa) · b = a · (αb) = α(a · b)
a · a = ni=1 ai2 > 0 ⇔ a 6= 0
P

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Determinants

Given a square matrix A = (aij )n×n , we introduce the determinant


of A, denoted as |A| or det(A).
We firstly show the cases n = 2 and n = 3:
n=2
 
a11 a12
A= ⇒ |A| = a11 a22 − a12 a21
a21 a22

n=3  
a11 a12 a13
A =  a21 a22 a23 
a31 a32 a33
⇒ |A| = a11 a22 a33 − a11 a23 a32 + a12 a23 a31 − a12 a21 a33 +
a13 a21 a32 − a13 a22 a31

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Determinants

Example 14


0 1 2 1 1 1 −1 0
= −2, =3 =0 = −2
2 3 1 2 2 2 0 2

1
2 −1 1 3 0

1 3 2

2
0 4 = −44, 0 0 1 =7 0 1 1 =4

−1 4 3 −2 1 4 0 0 4


1 0 0
4 2 2 1 0 0


0 2 0 = 2,
2 1 1 = 0 1 1 0 = 1
0 0 1 3 0 5 2 2 1

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Determinants

The formal definition of the determinant of a square matrix


requires the notion of permutation (or shuffling) of 1, 2, . . . , n.
Recall that n! = n · (n − 1) · (n − 2) · · · 2 · 1 is the the number of all
such permutations.
The determinant of A is the sum of n! terms each being a product
of n elements of the matrix, one element for each row and one for
each column, of the type

a1p1 a2p2 · · · anpn

where p1 , p2 , . . . , pn is a permutation of 1, 2, . . . , n.
Numerical methods are usually considered for the computation of
the determinant.

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Determinants

Rules for determinants


Let A be a n × n matrix.
if all the entries in a column or in a row are 0, then |A| = 0
|A0 | = |A|
if all the elements of a row (or column) are multiplied by a
scalar α, the determinant is α|A|
if two rows or columns are interchanged, the determinant
changes sign
if two rows (or columns) are proportional (e.g. equal), then
|A| = 0
|AB| = |A||B|
if α ∈ R, then |αA| = αn |A|
Qn
if A is triangular then |A| = i=1 aii

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Rank

m vectors v1 , v2 , . . . , vm in Rn are linearly independent when the


identity
α1 v1 + α2 v2 + · · · + αm vm = 0
implies that α1 = α2 = · · · = αm = 0. In other words, vectors are
linearly independent if it is not possible to obtain one of them by a
linear combination of the others. Otherwise they are said to be
linearly dependent.
Example
 15    
1 0 2
v1 =  0 , v2 =  1 , v3 =  1  are dependent since
2 1 5

2v1 + v2 − v3 = 0.

Hence v3 = 2v1 + v2 .

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Rank

The rank ρ(A) of a matrix A is the maximum number of rows or


columns which are linearly independent.
Rules for the calculus of the rank.
ρ(A) is an integer number
ρ(A) ≥ 0; in particular ρ(A) = 0 if and only if A = 0 (the
zero-matrix)
ρ(A) ≤ min{m, n}, that is the rank is at most equal to the
minimum between the number of rows and columns
For a square matrix A of order n it is possible to prove that

ρ(A) = n ⇔ |A| =
6 0

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Systems of linear equations

Let us consider a system of linear equations m × n




 a11 x1 + a12 x2 + · · · + a1n xn = b1
 a21 x1 + a22 x2 + · · · + a2n xn = b2

.. . (1)


 . = ..
am1 x1 + am2 x2 + · · · + amn xn = bm

Let us define the matrix of coefficients A = (aij )m×n and the


(columns) vectors b = (bj )m×1 and x = (xi )n×1 :
     
a11 a12 · · · a1n b1 x1
 a21 a22 · · · a2n   b2   x2 
A= . , b = , x =
     
.. .. .. ..  .. 
 ..
  
. . .   .   . 
am1 am2 · · · amn bm xn

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Systems of linear equations

We represent the linear system (1) in matrix notation as

Ax = b (2)

The system is therefore characterized by m equations in n


unknowns. A solution of (1) or (2) is a vector y satisfying
simultaneously all the equations , i.e. Ay = b.
It can be seen that such a system may have no solutions, one
solution, ... , infinite solutions, depending on the matrix A and the
vector b.
The following Theorem gives a condition for which the system
admits solutions and characterizes their ‘’number”

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Systems of linear equations

Let us firstly define the augmented matrix [A|b]:


 
a11 a12 · · · a1n b1
 a21 a22 · · · a2n b2 
[A|b] =  .
 
.. .. .. ..
 ..

. . . . 
am1 am2 · · · amn bm

Theorem 16 (Rouché-Capelli)
The system Ax = b admits solutions (or it is consistent) if and
only if
ρ(A) = ρ(A|b).
Moreover, if the system is consistent, the number of solutions is
∞n−ρ(A) .

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Systems of linear equations

What is the meaning of having ∞n−ρ(A) solutions?


if ρ(A) = n, then the solution is unique
if ρ(A) = n − 1, then the system has ∞1 solutions. That is,
the system has an infinity of solutions spanning a stright line
if ρ(A) = n − 2, then the system has ∞2 solutions. That is,
the system has an infinity of solutions spanning a plane

Corollary 17
Let A = (aij )n×n and b = (bj )n×1 . The (square) linear system
Ax = b has a unique solution if and only if |A| =
6 0.

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Systems of linear equations

Remark 2 (Geometrical interpretation)


A matrix A = (aij )m×n may be seen as a map transforming Rn
vectors in Rm vectors:

A : Rn → Rm
x 7→ Ax = y

The matrix A represents a linear transformation from Rn to Rm .

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Inverse matrices

Given a (square) matrix A = (aij )n×n , we say that A−1 is the


inverse of A if and only if

A−1 A = AA−1 = In

If such a matrix exists, A is said invertible. It is possible to prove


that
A is invertible ⇔ |A| = 6 0 ⇔ ρ(A) = n
In such a case the inverse matrix A−1 is unique.
Example 18
   
a b −1 1 d −b
A= ⇒A =
c d ad − cb −c a
being |A| = ad − bc 6= 0.

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Inverse matrices

By using the inverse matrix, we may represent easily the solution of


a square linear system. Let us consider the linear system Ax = b:
then, if the inverse matrix A−1 exists, we have

Ax = b ⇔ A−1 Ax = A−1 b ⇔ x = A−1 b

since A−1 A = I .
Properties of the inverse. Let A and B invertible n × n matrices:
A−1 is invertible and (A−1 )−1 = A
AB is invertible and (AB)−1 = B −1 A−1
A0 is invertible and (A0 )−1 = (A−1 )0
(αA)−1 = α1 A−1 , whenever α 6= 0.

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Homogeneous systems of equations

A system of linear equations in which b = 0 is said homogeneous

Ax = 0
It is immediately seen that a homogeneous system has always the
so-called trivial solution x1 = x2 = · · · = xn = 0.
Are there non-trivial (i.e. different from zero) solutions?
As a consequence of the Rouché-Capelli Theorem we have the
following result:
Theorem 19 (Solutions of homogeneous systems)
Let A = (aij )n×n , then the homogeneous linear system with n
equations and n unknowns Ax = 0 has non-trivial solutions if and
only if |A| = 0 (that is A is singular).

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Lienar systems of equations

Example 20

x1 + x2 = 0
x1 − x2 = 0
The matrix associated to the system is
 
1 1
A=
1 −1

The determinant is det(A) = −2 6= 0. Hence the rank of the


matrix is ρ(A) = 2 and the soultion is unique x1 = 0, x2 = 0.

Geometrically the solution is the intersection point of the two


stright lines represented by the two equations in the system.

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Linear systems of equations

Example 21

x1 − x2 = 0
2x1 − 2x2 = 0
The matrix associated to the system is
 
1 −1
A=
2 −2

The determinant is det(A) = 0 and the rank is ρ(A) = 1 since the


two rows are linearly dependent. Then the system has ∞1
solutions: x1 = t, x2 = t for any real number t.

Geometrically the two equations represent the same stright line


(the bisector), and hence all the points along the bisector are
solutions.
Nicolosi/Ramponi QMF (a-b) - A.A. 22/23
Linear systems of equations

Example 22

x1 − x2 = 0
x1 − x2 = 1
The matrix A and vector b associated to the system are
   
1 −1 0
A= b=
1 −1 1

The rank of A is ρ(A) = 1 since the two rows are the same.
However ρ(A|b) = 2. Then the system has no solutions.

Geometrically the two equations represent two parallel stright lines


which do not intersect at any point. This is why the system has no
solutions.

Nicolosi/Ramponi QMF (a-b) - A.A. 22/23


Linear systems of equations
Example 23

x1 − x2 = 2
x1 + x2 = 1
The matrix A and vector b associated to the system are
   
1 −1 2
A= b=
1 1 1

The rank of A is ρ(A) = 2. Also ρ(A|b) = 2. Then the system has


a unique solution that is
      
x1 1 1 1 2 1 3
= A−1 b = =
x2 2 −1 1 1 2 −1

Geometrically the two equations represent two stright lines which


intersect in a point.
Nicolosi/Ramponi QMF (a-b) - A.A. 22/23

You might also like