Education 231A

Multivariate Analysis

Matrix Inversion Example


Inversion by Hand

Let's find the inverse of this matix:

First we will augment Matrix A with an identity matrix and call the result A0.

We will also need an identity matrix called I0.

Step 1

Now we will work on the first column of I0. The diagonal element in the first column of A0 is called the pivot. We will replace the first diagonal element of I0 with 1/a11. Then we will replace the non-pivot elements with -aij/a11 and call the result I1.
Computer A1 = I1 * A0.

Step 2

Now we repeat the process by modifying the second column of I0. This time the pivot value is the 22 element. The new matrix is called I2.
Compute A2 = I2 * A1.

Step 3

Lastly we repeat the process by modifying the third column of I0. This time the pivot value is the 33 element. The new matrix is called I3.
Compute A3 = I3 * A2.

The last three columns of A3 are the inverse of A, thus:

Stata Example

matrix A = (4,2,2 \ 4,6,8 \ -2,2,4)

matrix list A

A[3,3]
    c1  c2  c3
r1   4   2   2
r2   4   6   8
r3  -2   2   4

matrix A1 = inv(A)

matrix list A1

A1[3,3]
      r1    r2    r3
c1     1   -.5    .5
c2    -4   2.5    -3
c3   2.5  -1.5     2


Ed231A Page

UCLA Department of Education

Phil Ender, 30Jun98