Multivariate Analysis
Matrix Operations


The Matrix

Multiplication by a Scalar

Matrix Addition & Subtraction

Matrix Multiplication

Notes

Transpose of a Matrix

Triangular Matrix

Inverse of a Matrix

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.
Compute 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:

Mata Example:

i=I(3)
a = (4,2,2\4,6,8\-2,2,4)
a

a = a,i
a

i1 = (.25,0,0\-1,1,0\.5,0,1)
i1

i2 = (1,-.125,0\0,.25,0\0,-.75,1)
i2
         
i3=(1,0,.5\0,1,-3\0,0,2)
i3

ainv = i3*i2*i1*a
ainv

ainv = ainv[1..., 4..6]
ainv

Determinant of a Matrix

Example: Inverse & Determinant of a Matrix

Computing Column & Row Sums

Horizontal Concatenation

Vertical Concatenation (Appending)


Multivariate Course Page

Phil Ender, 11oct05, 30Jun98