## ELEM: Matrix Elements

This record specifies from one to three elements of a matrix (or standard deviations for a correlation matrix). It is used in supplying the matrix data following CORR, COV, or WGT records. The format of the ELEM record is as follows:

The use of ELEM records depends on what type and form of matrix they are used to define. In general, the elements of a matrix are input in the order that they would be read if we were reading a book: from left to right, then from top to bottom. The following paragraphs describe each case.

ELEM M(1, 1) M(2, 2) M(3, 3)

ELEM M(4, 4) M(5, 5)

That is, the diagonal elements are simply input in order with three elements on each record (except the last if the size of the matrix is not a multiple of 3).

M(1,1) M(1,2) M(1,3) M(1,4) M(1,5)

M(2,2) M(2,3) M(2,4) M(2,5)

M(3,3) M(3,4) M(3,5)

M(4,4) M(4,5)

M(5,5)

This matrix would be input as follows:

ELEM M(1, 1) M(1, 2) M(1, 3)

ELEM M(1, 4) M(1, 5)

ELEM M( 2, 2) M( 2, 3) M( 2, 4)

ELEM M( 2, 5)

ELEM M( 3, 3) M( 3, 4) M( 3, 5)

ELEM M( 4, 4) M( 4, 5)

ELEM M( 5, 5)

Note that when we start inputting a new row (at a diagonal element) we must start with a new record.

ELEM S(1) S(2) S(3)

ELEM S(4) S(5)

**The format of this record is as follows (from column - to column: description):**- 002-005: ELEM
- 007-029: Matrix element
- 031-053: Matrix element
- 055-077: Matrix element
- 079-080: Linear unit name

The use of ELEM records depends on what type and form of matrix they are used to define. In general, the elements of a matrix are input in the order that they would be read if we were reading a book: from left to right, then from top to bottom. The following paragraphs describe each case.

**Diagonal Matrices (DIAG):**Diagonal matrix records only specify the diagonal elements of a matrix from the upper-left to the lower-right of the matrix. For a 5x5 matrix, the ELEM records would be as follows:ELEM M(1, 1) M(2, 2) M(3, 3)

ELEM M(4, 4) M(5, 5)

That is, the diagonal elements are simply input in order with three elements on each record (except the last if the size of the matrix is not a multiple of 3).

**Upper-Triangular Matrices (UPPR):**The matrix elements input for an upper-triangular matrix are all elements on and above the main diagonal of the matrix. For a 5x5 matrix the upper-triangular elements are as follows:M(1,1) M(1,2) M(1,3) M(1,4) M(1,5)

M(2,2) M(2,3) M(2,4) M(2,5)

M(3,3) M(3,4) M(3,5)

M(4,4) M(4,5)

M(5,5)

This matrix would be input as follows:

ELEM M(1, 1) M(1, 2) M(1, 3)

ELEM M(1, 4) M(1, 5)

ELEM M( 2, 2) M( 2, 3) M( 2, 4)

ELEM M( 2, 5)

ELEM M( 3, 3) M( 3, 4) M( 3, 5)

ELEM M( 4, 4) M( 4, 5)

ELEM M( 5, 5)

Note that when we start inputting a new row (at a diagonal element) we must start with a new record.

**Correlation Matrices:**Correlation matrices are input as described above. However, in addition to the correlation matrix itself, we also must input the standard deviations immediately after the matrix ELEM records. The standard deviations are in put on ELEM records in the same way as diagonal matrix elements are input. For the 5x5 matrix example we would input the five standard deviations as follows:ELEM S(1) S(2) S(3)

ELEM S(4) S(5)