MF-852 Financial Econometrics Lecture 1 Overview of Matrix Algebra and Excel Roy J. Epstein Fall 2003
Contact Info BC email: epsteira@mail.bc.edu
Matrices—Some Definitions A matrix is a rectangular array of real numbers. Denote a matrix with an upper case italic letter, e.g.,
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,
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.
Scalar Multiplication Let k be a scalar (i.e., a given real number). kA is a new matrix where each element equals kaij.
Matrix Addition A + B is a new matrix where each element is the sum of the corresponding elements of A and B.
Matrix Addition Addition is only defined if the matrices have the same dimensions. makes no sense.
Matrix Subtraction A – B = A + (–1)B. So subtraction also requires the matrices to have the same dimensions.
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 .
Matrix Rules for Addition A + B = B + A (A + B) + C = A + (B + C) (A + B) = A + B
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
“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 0 + 4 x 2 + 2(-3) = 2.
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.
Matrix Multiplication Example:
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?
Matrix Rules for Multiplication A(BC ) = (AB)C A(B+C) = AB + AC (B+C)A = BA + CA (AB) = B A (ABC) = C BA
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.
The Identity Matrix and Multiplication For scalars, 1 is the multiplicative identity: 1() = ()1 = . For matrices, AI = IA = A.
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.
Inverse Matrix Example
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!
Singular and Non-Singular Matrices
Block Diagonal Matrix Suppose A has sub-matrices along its main diagonal and is zero elsewhere. Then A is block diagonal, e.g.,
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.
Matrix Representation The equation coefficients are a matrix A: The unknowns are a vector x: The constants are a vector c.
Matrix Solution The equation system can be written Multiply both sides by A –1 Solution is (since A –1A =I)
Matrix Solution Check: So x1 = 0 and x2 = 0.5.
Excel and Matrices SUMPRODUCT MMULT TRANSPOSE MINVERSE Dot product Matrix and vector multiplication TRANSPOSE Matrix and vector transpose MINVERSE Matrix inverse
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.