3 - 3 An Useful Overview Of: Definitions Operations SAS/IML Matrix Commands
3 - 3 An Useful Overview Of: Definitions Operations SAS/IML Matrix Commands
Matrix Algebra
Definitions
Operations
SAS/IML matrix commands
What is it?
Matrix algebra is a means of making
calculations upon arrays of numbers (or
data).
Most data sets are matrix-type
Why use it?
Matrix algebra makes mathematical
expression and computation easier.
It allows you to get rid of cumbersome
notation, concentrate on the concepts
involved and understand where your results
come from.
Definitions - scalar
a scalar is a number
– (denoted with regular type: 1 or 22)
Definitions - vector
Vector: a single row or column of numbers
– denoted with bold small letters
– row vector
a = 1 2 3 4 5
– column vector
1
2
b= 3
4
5
Definitions - Matrix
A matrix is an array of numbers
a11 a12
a11 a21 a31
A a21 a22 A'
a a a12 a22 a32
31 32
e1
e n
e' e e1 e2 en 2 i
e 2
i 1
en
Special matrices
There are a number of special matrices
– Diagonal
– Null
– Identity
Diagonal Matrices
– A diagonal matrix is a square matrix that has
values on the diagonal with all off-diagonal
entities being zero.
a11 0 0 0
0 a22 0 0
0 0 a33 0
0 0 0 a44
Identity Matrix
An identity matrix is a diagonal matrix
where the diagonal elements all equal one.
1 0 0 0
0 1 0 0
I=
0 0 1 0
0 0 0 1
AI=A
Null Matrix
A square matrix where all elements equal zero.
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
The Determinant of a Matrix
The determinant of a matrix A is denoted by
|A| (or det(A)).
Determinants exist only for square matrices.
They are a matrix characteristic, and they
are also difficult to compute
The Determinant for a 2x2 matrix
If A = a11 a12
a
21 a22
Then
A a11a22 a12a21
Properties of Determinates
Determinants have several mathematical properties
which are useful in matrix manipulations.
– 1 |A|=|A'|.
– 2. If a row or column of A = 0, then |A|= 0.
– 3. If every value in a row or column is multiplied by k,
then |A| = k|A|.
– 4. If two rows (or columns) are interchanged the sign,
but not value, of |A| changes.
– 5. If two rows or columns are identical, |A| = 0.
– 6. If two rows or columns are linear combination of
each other, |A| = 0
Properties of Determinants
– 7. |A| remains unchanged if each element of a
row or each element multiplied by a constant, is
added to any other row.
– 8. |AB| = |A| |B|
– 9. Det of a diagonal matrix = product of the
diagonal elements
Rank
The rank of a matrix is defined as
rank(A) = number of linearly independent rows
= the number of linearly independent columns.
A' 1
A -1 '
A -1 1
A
How to find inverse matrixes?
determinants? and more?
If a b and |A| 0
A
c d
1 d b
A -1
c a
det( A)