6.1 Some definitions

Suppose we have a matrix \(X\) with \(n\) rows and \(p\) columns; that is, \(X\) is an \(n\times p\) matrix. Matrices are usually denoted by an upright capital letter: \(X\).

The matrix \(X^T\) is the transpose of matrix \(X\), where the rows of matrix \(X\) become the corresponding columns of matrix \(X^T\). The transpose has size \(p\times n\).

Example 6.1 (Transposing) Consider the \(2\times 3\) matrix \(M\), defined as \[ M = \left[ \begin{array}{rrr} 3 & -1 & 12\\ 2 & -4 & 0 \end{array} \right]. \] Then the \(3\times 2\) transpose is \[ M^T = \left[ \begin{array}{rr} 3 & 2 \\ -1 & -4\\ 12 & 0 \end{array} \right]. \]

A square matrix has the same number of rows as columns.

Example 6.2 (Square matrix) The \(2\times 2\) matrix \(D\) is a square matrix: \[ D = \left[ \begin{array}{rr} 5 & -11\\ 2.25 & 7 \end{array} \right]. \]

A square matrix with zeros on the off-diagonal elements is called a diagonal matrix.

Example 6.3 (Diagonal matrix) The \(2\times 2\) matrix \(P\) is a diagonal matrix: \[ P = \left[ \begin{array}{rr} -3.1 & 0\\ 0 & 2.5 \end{array} \right]. \]

A diagonal matrix with ones and only ones on the diagonal is called an identity matrix, sometimes written \(I\).

Example 6.4 (Identity matrix) The identity matrix of size \(3\times 3\) is \[ \left[ \begin{array}{ccc} 1 & 0 & 0\\ 0 & 1 & 0\\ 0 & 0 & 1 \end{array} \right], \] sometimes written \(I_3\) where the subscript indicates the size of the (square) matrix.

A vector is a single-column matrix, usually denoted using bold letters. For example, consider the vector \[ \textbf{a} = \left[ \begin{array}{r} 1\\ 0\\ -6 \end{array} \right]. \]