In mathematics, especially in linear algebra and matrix theory, the duplication matrix and the elimination matrix are linear transformations used for transforming half-vectorizations of matrices into vectorizations or (respectively) vice versa.
The duplication matrix
Dn
n2 x
n(n+1) | |
2 |
n x n
A
vech(A)
vec(A)
Dnvech(A)=vec(A)
For the
2 x 2
A=\left[\begin{smallmatrix}a&b\ b&d\end{smallmatrix}\right]
Dnvech(A)=vec(A)\implies\begin{bmatrix}1&0&0\ 0&1&0\ 0&1&0\ 0&0&1\end{bmatrix}\begin{bmatrix}a\ b\ d\end{bmatrix}=\begin{bmatrix}a\ b\ b\ d\end{bmatrix}
The explicit formula for calculating the duplication matrix for a
n x n
T | |
D | |
n |
=\sum\limitsiuij(vecTij)T
Where:
uij
1 | |
2 |
n(n+1)
1
(j-1)n+i-
1 | |
2 |
j(j-1)
Tij
n x n
(i,j)
(j,i)
Here is a C++ function using Armadillo (C++ library):
An elimination matrix
Ln
n(n+1) | |
2 |
x n2
n x n
A
vec(A)
vech(A)
Lnvec(A)=vech(A)
By the explicit (constructive) definition given by, the
1 | |
2 |
n(n+1)
n2
Ln
Ln=\sumiuijvec(Eij)T=\sumi(uij ⊗
T | |
e | |
j |
⊗
T), | |
e | |
i |
ei
i
Eij=eie
T | |
j |
Here is a C++ function using Armadillo (C++ library):
For the
2 x 2
A=\left[\begin{smallmatrix}a&b\ c&d\end{smallmatrix}\right]
Lnvec(A)=vech(A)\implies\begin{bmatrix}1&0&0&0\ 0&1&0&0\ 0&0&0&1\end{bmatrix}\begin{bmatrix}a\ c\ b\ d\end{bmatrix}=\begin{bmatrix}a\ c\ d\end{bmatrix}