Download presentation
Presentation is loading. Please wait.
1
MF-852 Financial Econometrics
Lecture 1 Overview of Matrix Algebra and Excel Roy J. Epstein Fall 2003
2
Contact Info BC
3
Matrices—Some Definitions
A matrix is a rectangular array of real numbers. Denote a matrix with an upper case italic letter, e.g.,
4
Matrices—Some Definitions
A has m rows and n columns. The dimension of A is “m x n” (m by n). A vector is a matrix with a single row or a single column (denoted with a lower case letter without a subscript), e.g,
5
Matrices—Some Definitions
If n = m then A is a square matrix. If A is square and aij = aji then A is symmetric, e.g., is a symmetric matrix.
6
Scalar Multiplication
Let k be a scalar (i.e., a given real number). kA is a new matrix where each element equals kaij.
7
Matrix Addition A + B is a new matrix where each element is the sum of the corresponding elements of A and B.
8
Matrix Addition Addition is only defined if the matrices have the same dimensions. makes no sense.
9
Matrix Subtraction A – B = A + (–1)B. So subtraction also requires the matrices to have the same dimensions.
10
Matrix Transpose The transpose of a matrix is a new matrix where the rows and columns are switched. The transpose of A is denoted A .
11
Matrix Rules for Addition
A + B = B + A (A + B) + C = A + (B + C) (A + B) = A + B
12
Summation Operator We often need to add up the elements of a vector or matrix. We use a convenient notation for this. Suppose a = (a1, a2, …, an). Define
13
“Dot” (or “Inner”) Product
The “dot” product “multiplies” two vectors (we ignore other vector multiplication concepts). The dot product of a and b is defined as ab = ∑aibi (a and b must have the same number of elements). Suppose then ab = 1 x x 2 + 2(-3) = 2.
14
Matrix Multiplication
Matrix multiplication AB is defined in terms of dot products. The result is a new matrix C. Each cij is a dot product. The dot product involves the ith row of A and the jth column of B.
15
Matrix Multiplication
Example:
16
Matrix Multiplication
# columns in A = # rows in B or matrix multiplication is not defined. Questions: Does AB = BA? Do A and B have to be square in order to multiply them? Is AA square?
17
Matrix Rules for Multiplication
A(BC ) = (AB)C A(B+C) = AB + AC (B+C)A = BA + CA (AB) = B A (ABC) = C BA
18
The Identity Matrix An identity matrix has 1’s on the diagonal and 0 everywhere else. aii = 1, aij=0 i j is a 3 x 3 identity matrix.
19
The Identity Matrix and Multiplication
For scalars, 1 is the multiplicative identity: 1() = ()1 = . For matrices, AI = IA = A.
20
Matrix Inverse For 0, –1 is the multiplicative inverse: –1() = ()–1 = 1. For matrices, A –1 is the inverse of A: A –1A = A A –1 = I. Excel (and other programs) will calculate A –1.
21
Inverse Matrix Example
22
Singular Matrix For = 0, –1 does not exist.
Sometimes A –1 does not exist. In this case A is called singular or non-invertible. Excel sometimes calculates an inverse of a singular matrix when there is a lot of roundoff error—be aware!
23
Singular and Non-Singular Matrices
24
Block Diagonal Matrix Suppose A has sub-matrices along its main diagonal and is zero elsewhere. Then A is block diagonal, e.g.,
25
Matrices and a System of Linear Equations
Suppose we have a system of 2 linear equations in 2 unknowns, e.g., Matrices lead to a simple solution.
26
Matrix Representation
The equation coefficients are a matrix A: The unknowns are a vector x: The constants are a vector c.
27
Matrix Solution The equation system can be written
Multiply both sides by A –1 Solution is (since A –1A =I)
28
Matrix Solution Check: So x1 = 0 and x2 = 0.5.
29
Excel and Matrices SUMPRODUCT MMULT TRANSPOSE MINVERSE Dot product
Matrix and vector multiplication TRANSPOSE Matrix and vector transpose MINVERSE Matrix inverse
30
Excel and Matrices Highlight a range of cells that has the proper dimension for the result of the matrix function. Enter the matrix formula, e.g., =MINVERSE(b3:d5) Press CTRL+SHIFT+ENTER.
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.