1 Matrix Inverse

Go to the MLX, M, PDF, or HTML version of this file. Go back to fan’s MEconTools Package, Matlab Code Examples Repository (bookdown site), or Math for Econ with Matlab Repository (bookdown site).

1.1 Inverse of a Matrix

The inverse of \(5\) is \(\frac{1}{5}\), multiplying the two numbers together gives us 1. What is the inverse of a matrix?

The product of the inverse of a matrix and the matrix itself is the identity matrix.

  • \(\displaystyle X^{-1} X=I\)

  • \(\displaystyle XX^{-1} =I\)

If we generate any random square matrix in matlab, there is always an inverse:

X = rand(3,3)

X = 3x3    
    0.5824    0.8004    0.9848
    0.0707    0.2859    0.7157
    0.9227    0.5437    0.8390

Xinverse = X^(-1)

Xinverse = 3x3    
   -0.8663   -0.7903    1.6911
    3.4905   -2.4393   -2.0163
   -1.3091    2.4499    0.6386

Identity = X*Xinverse

Identity = 3x3    
    1.0000    0.0000    0.0000
   -0.0000    1.0000         0
         0   -0.0000    1.0000

1.2 Rank of a Matrix

  • (SB P142) Rank: The rank of a matrix is the number of non-zero rows in its row echelon form

The Rank of a matrix is the number of non-zero rows in the row-echelon form of the matrix. With 2 equations and 2 unknowns, it just means the two lines are not parallel to each other. If two lines are parallel, then through elementary row operations, one will become all zero, and the system of equations will have no solution.

1.3 Invertible Matrix

A square matrix that is invertible has full rank, which means the number of rows equals to the number of columns and the rank of the matrix. This matrix is full-ranked, non-singular and invertible.

1.4 Solving System of Equations using Inverse

Given the \(N\) by \(N\) coefficient matrix \(W\) from a system of linear equations, a \(N\) by \(1\) vector of unkonwns \(X\), and \(N\) by \(1\) vector of outcome values \(v\):

  • \(\displaystyle W\cdot X=v\)

We can solve for the unknowns by using inverse:

  1. multiply inverse both sides:\((W^{-1} \cdot W)\cdot X=W^{-1} \cdot v\)

  2. left-hand side bomces: \(I\cdot X=W^{-1} \cdot v\)

  3. Identity times a matrix is that matrix, hence: \(X=W^{-1} \cdot v\)

When we use matlab, as an alternative to using the function linsolve, we can solve for the unknown \(X\) just by taking the inverse of the coefficient matrix \(W^{-1}\) and multiply it by \(v\).