Professional Documents
Culture Documents
Key Concepts
Matrix Algebra Finding the inverse matrix Solving systems of equations
Matrix Algebra
A matrix is simply a rectangular array of numbers. Some examples:
The dimensions of a matrix is given by the number of rows and columns, so that the above matrices have dimensions 3x3, 2x2, 3x1, and 1x1.
Matrix Algebra
The elements of a matrix are addressed by row and column so that, for example:
A is an example of a square matrix, i.e. One with equally many rows as columns. Examples of symmetric and diagonal matrices are
The diagonal where A_2 has its non-zero entries is called the principal or the main diagonal.
4
For addition and subtraction to be defined, the matrices need to be of the same dimensions, i.e. have the same number of rows and columns. Note that these operations also can be described by
For multiplication to be defined, the first matrix must have the same number Of columns as the second matrix has row. The result will have as many rows as the first matrix, and as many columns as the second one. Again, note:
57 + 45 + 99 67 + 45 + 129 37 + 25 + 79
For example:
Note that AB is usually not equal to BA, and both are defined only when both A and B are square matrices. And not every matrix has an inverse.
8
Recall that A x A-1 = I, A matrix that has an inverse is called invertible Only square matrices have inverses and are called nonsingular There are many techniques to define the inverse of a matrix, we will discuss the Gauss-Jordan method: 2 4 Say you need to find the inverse of A = 4 2 The first step is to augment it with the identity matrix: 2 4 1 0 , we will refer to this augmented matrix as matrix A. 4 2 0 1 Next a series of row operations will be performed until the identity matrix appears on the left side of matrix A. Since the same row operations will be applied on both sides, the right side elements will comprise the inverse matrix A-1
10
Step 3: Obtain an 1 in the lower right corner of the left side matrix by multiplying row 2B by 2/3: 1 0 0 2 0.5 1 1 , 1 3 6 2B x ( ) = 2C
11
2 3
1 6
1B - (2C x 2) = 1C
The left side of the augmented matrix is the identity matrix and the right side is the A-1, the inverse of matrix A.
12
s
C-1 s = x, so we need the inverse of C:
14
20 0 50 50 25 1 3 3 C-1
can be written
which is equal to
i.e. x = - and y = 5.
16
Lets re-write what we did with two assets using matrix notation:
The symmetric matrix V is called the covariance matrix for the portfolio.
17
where
and the covariance matrix V is given by
18
Benefits of Diversification
If in the variance formula we choose uncorrelated assets, then
and if we choose all W_j to be equal to 1/n, i.e. we allocate equal funds to all n assets, then
assuming that all variances are less than 1 (which is reasonable). So we can conclude that we can make our risk very small by diversifying! The drawback is of course that portfolio performance will be very average.
19
Exercise 7.4
Multiply the following matrices: a. d.
e.
20
Exercise 7.4
4 + 2 2 0 2 2 = a. = 12 4 0 1 6 + 3
2 2 12 4
d.
= 4 4 + 5 5 + 6 6 = 77
16 = 20 24
20 25 30
24 30 36
21
Exercise 7.6
The expected returns for three stocks in portfolio P are 0.07 for stock X, 0.09 for stock Y, and 0.13 for stock Z. The variance of returns for stock X is 0.04, 0.16 for stock Y and 0.36 for stock Z. The covariance between returns on stocks X and Y is 0.01, 0.02 between stocks X and Z, and 0.08 between stocks Y and Z. Stock X comprises 30% of the portfolio, Y comprises 50% of the portfolio, and Z comprises 20%.
Write an expected returns vector for the three stocks Write the covariance matrix for the three stocks. Write the weights vector for the portfolio. What are the dimensions for the three matrices written for parts (a), (b) and (c)? Find the expected return of the portfolio using matrices written for part (a), (b) and (c). Find the variance of returns for the portfolio using matrices written for parts (a), (b) and (c).
22
Exercise 7.6
0.07 a. = 0.09 0.13 b. =
Note that: = 2 , = 2 , = 2
23
Exercise 7.6
e.
0.07 = 0.30 0.50 0.20 0.09 = 0.09 0.13 = 0.04 0.01 0.02 0.30 = 0.30 0.50 0.20 0.01 0.16 0.08 0.50 = 0.0794 0.02 0.08 0.36 0.20 =
f.
2
2
24
Exercise 7.7
Invert the following matrices:
a. = 8 = 0.125 1 0 = , the inverse of the identity matrix is the identity matrix. 0 1 0.25 0 c. = 0 2 b. in order to find the invert of a diagonal matrix simply invert each of the principle diagonal elements d. Step 1: augment the matrix with the identity matrix: 1 2 1 0 row 1 3 4 0 1 row 2
1
25
Exercise 7.7
1 0 1 2 1 1 0 0.6 3
1 0 2 1 0 1 1.5 0.5
1a = 1 x 1 1b = 2 x (1/3) (1a)
2a = 1a 2 x (2b)
2b = 2a x (1/(-0.6))
26