1. Home
  2. Matrix functions

Matrix functions

These functions perform matrix operations:

    PRODUCT Matrix product (the same as the operator *+)
    LTPRODUCT Product after transposing left matrix, i.e. L′ *+ R
    RTPRODUCT Product after transposing right matrix, i.e. L *+ R′
    QPRODUCT Quadratic product, i.e. M *+ S *+ M′
    QTPRODUCT Quadratic transposed matrix product, i.e. M′ *+ S *+ M
    DETERMINANT Determinant of a square matrix
    INVERSE Inverse of a square, symmetric or diagonal matrix
    GINVERSE Moore-Penrose generalized inverse
    TRANSPOSE Transpose of a matrix, i.e. M′
    TRACE Trace of a square matrix
    CHOLESKI Choleski decomposition of a matrix
    EVALUES Eigenvalues (as a diagonal matrix)
    EVECTORS Eigenvectors (as a rectangular matrix)
    SVALUES Singular values (as a diagonal matrix)
    LSVECTORS Matrix of left-hand vectors from a singular-value decomposition
    RSVECTORS Matrix of right-hand vectors from a singular-value decomposition
    DPRODUCT Direct product of matrices (synonym KRONECKER)
    DSUM Direct sum of matrices
    MCENTRE Doubly centre matrix so that rows and columns have mean zero
    MEXP Matrix exponential
    MPOWER Matrix power
    MSQRT Matrix square root
    CORRMAT Correlation matrix derived from a symmetric matrix
    SUBMAT Forms sub-triangles or sub-rectangles
    DIAGONAL Forms a diagonal matrix from a variate, or takes diagonal (or banded diagonal) of a square, symmetric or diagonal matrix
    LTRIANGLE Takes lower triangle of a square matrix (setting upper to zero)
    UTRIANGLE Takes upper triangle of a square matrix (setting lower to zero)
    COLBIND Joins two matrices side by side
    COLSUMS Sums of columns
    COLMEANS Means of columns
    COLNOBSERVATIONS Numbers of non-missing elements in columns
    COLCENTRE Centres columns by subtracting their means
    ROWBIND Joins (i.e. stacks) two matrices vertically
    ROWSUMS Sums of rows
    ROWMEANS Means of rows
    ROWNOBSERVATIONS Numbers of non-missing elements in rows
    ROWCENTRE Centres rows by subtracting their means
    MINSERT Inserts a matrix into another matrix.
    SOLUTION Solution of simultaneous linear equations
    VEC Stacks columns of a matrix into a single variate
    VECH Stacks columns of the lower triangle of a matrix

These functions generate matrices with particular structures:

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

These functions give information about matrices:

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

These functions form matrices from tables:

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

Was this article helpful?