1. Home
2. Matrix functions

# Matrix functions

These functions perform matrix operations:

    `PRODUCT` Matrix product (the same as the operator *+) Product after transposing left matrix, i.e. L′ *+ R Product after transposing right matrix, i.e. L *+ R′ Quadratic product, i.e. M *+ S *+ M′ Quadratic transposed matrix product, i.e. M′ *+ S *+ M Determinant of a square matrix Inverse of a square, symmetric or diagonal matrix Moore-Penrose generalized inverse Transpose of a matrix, i.e. M′ Trace of a square matrix Choleski decomposition of a matrix Eigenvalues (as a diagonal matrix) Eigenvectors (as a rectangular matrix) Singular values (as a diagonal matrix) Matrix of left-hand vectors from a singular-value decomposition Matrix of right-hand vectors from a singular-value decomposition Direct product of matrices (synonym `KRONECKER`) Direct sum of matrices Doubly centre matrix so that rows and columns have mean zero Matrix exponential Matrix power Matrix square root Correlation matrix derived from a symmetric matrix Forms sub-triangles or sub-rectangles Forms a diagonal matrix from a variate, or takes diagonal (or banded diagonal) of a square, symmetric or diagonal matrix Takes lower triangle of a square matrix (setting upper to zero) Takes upper triangle of a square matrix (setting lower to zero) Joins two matrices side by side Sums of columns Means of columns Numbers of non-missing elements in columns Centres columns by subtracting their means Joins (i.e. stacks) two matrices vertically Sums of rows Means of rows Numbers of non-missing elements in rows Centres rows by subtracting their means Inserts a matrix into another matrix. Solution of simultaneous linear equations Stacks columns of a matrix into a single variate Stacks columns of the lower triangle of a matrix

These functions generate matrices with particular structures:

    `IDENTITY` Identity matrix Column matrix of 1’s Row matrix of 1’s Matrix of ones Column matrix with `n` rows, value one in row `i` and zero elsewhere Matrix with ones at specified positions, and zeros elsewhere Zero matrix Synonym of `MZERO`

These functions give information about matrices:

    `NCOLUMNS` Gives the number of columns of a matrix Gives the number of rows of a matrix

These functions form matrices from tables:

    `TCOLUMN` Converts a one-way table into a column matrix Converts a one-way table into a diagonal matrix Converts a two-way table into a matrix Converts a one-way table into a row matrix
Updated on May 20, 2019