Go to the MLX, M, PDF, or HTML version of this file. Go back to Introductory Mathematics for Economists with Matlab (bookdown site). Also see M4Econ and MEconTools.
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
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.
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.
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\):
We can solve for the unknowns by using inverse:
multiply inverse both sides:\((W^{-1} \cdot W)\cdot X=W^{-1} \cdot v\)
left-hand side bomces: \(I\cdot X=W^{-1} \cdot v\)
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\).