Vectorization (mathematics)

Source: Wikipedia, the free encyclopedia.

In

linear transformation which converts the matrix into a vector
. Specifically, the vectorization of a m × n matrix A, denoted vec(A), is the mn × 1 column vector obtained by stacking the columns of the matrix A on top of one another:
Here, represents the element in the i-th row and j-th column of A, and the superscript denotes the
transpose. Vectorization expresses, through coordinates, the isomorphism between these (i.e., of matrices and vectors) as vector spaces.

For example, for the 2×2 matrix , the vectorization is .

Illustration video of vectorized addition

The connection between the vectorization of A and the vectorization of its transpose is given by the commutation matrix.

Compatibility with Kronecker products

The vectorization is frequently used together with the Kronecker product to express matrix multiplication as a linear transformation on matrices. In particular,

for matrices A, B, and C of dimensions k×l, l×m, and m×n.[note 1] For example, if (the
adjoint endomorphism of the Lie algebra gl(n, C) of all n×n matrices with complex
entries), then , where is the n×n identity matrix.

There are two other useful formulations:

More generally, it has been shown that vectorization is a self-adjunction in the monoidal closed structure of any category of matrices.[1]

Compatibility with Hadamard products

Vectorization is an

algebra homomorphism from the space of n × n matrices with the Hadamard
(entrywise) product to Cn2 with its Hadamard product:

Compatibility with inner products

Vectorization is a

inner product
to Cn2:
where the superscript denotes the
conjugate transpose.

Vectorization as a linear sum

The matrix vectorization operation can be written in terms of a linear sum. Let X be an m × n matrix that we want to vectorize, and let ei be the i-th canonical basis vector for the n-dimensional space, that is . Let Bi be a (mn) × m block matrix defined as follows:

Bi consists of n block matrices of size m × m, stacked column-wise, and all these matrices are all-zero except for the i-th one, which is a m × m identity matrix Im.

Then the vectorized version of X can be expressed as follows:

Multiplication of X by ei extracts the i-th column, while multiplication by Bi puts it into the desired position in the final vector.

Alternatively, the linear sum can be expressed using the Kronecker product:

Half-vectorization

For a

lower triangular portion, that is, the n(n + 1)/2 entries on and below the main diagonal
. For such matrices, the half-vectorization is sometimes more useful than the vectorization. The half-vectorization, vech(A), of a symmetric n × n matrix A is the n(n + 1)/2 × 1 column vector obtained by vectorizing only the lower triangular part of A:

For example, for the 2×2 matrix , the half-vectorization is .

There exist unique matrices transforming the half-vectorization of a matrix to its vectorization and vice versa called, respectively, the

elimination matrix
.

Programming language

Programming languages that implement matrices may have easy means for vectorization. In

a matrix A can be vectorized by A(:). GNU Octave also allows vectorization and half-vectorization with vec(A) and vech(A) respectively. Julia has the vec(A) function as well. In
R, function vec() of package 'ks' allows vectorization and function vech() implemented in both packages 'ks' and 'sn' allows half-vectorization.[2][3][4]

Applications

Vectorization is used in matrix calculus and its applications in establishing e.g., moments of random vectors and matrices, asymptotics, as well as Jacobian and Hessian matrices.[5] It is also used in local sensitivity and statistical diagnostics.[6]

Notes

  1. ^ a b The identity for row-major vectorization is .

See also

References