Duplication and elimination matrices
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.
Duplication matrix
The duplication matrix is the unique matrix which, for any symmetric matrix , transforms into :
:.
For the symmetric matrix , this transformation reads
:
The explicit formula for calculating the duplication matrix for a matrix is:
Where:
- is a unit vector of order having the value in the position and 0 elsewhere;
- is a matrix with 1 in position and and zero elsewhere
Here is a C++ function using Armadillo (C++ library):
arma::mat duplication_matrix(const int &n) {
arma::mat out((n*(n+1))/2, n*n, arma::fill::zeros);
for (int j = 0; j < n; ++j) {
for (int i = j; i < n; ++i) {
arma::vec u((n*(n+1))/2, arma::fill::zeros);
u(j*n+i-((j+1)*j)/2) = 1.0;
arma::mat T(n,n, arma::fill::zeros);
T(i,j) = 1.0;
T(j,i) = 1.0;
out += u * arma::trans(arma::vectorise(T));
}
}
return out.t();
}
Elimination matrix
An elimination matrix is a matrix which, for any matrix , transforms into :
:. {{harvtxt|Magnus|Neudecker|1980}}, Definition 3.1
By the explicit (constructive) definition given by {{harvtxt|Magnus|Neudecker|1980}}, the by elimination matrix is given by
:
where is a unit vector whose -th element is one and zeros elsewhere, and .
Here is a C++ function using Armadillo (C++ library):
arma::mat elimination_matrix(const int &n) {
arma::mat out((n*(n+1))/2, n*n, arma::fill::zeros);
for (int j = 0; j < n; ++j) {
arma::rowvec e_j(n, arma::fill::zeros);
e_j(j) = 1.0;
for (int i = j; i < n; ++i) {
arma::vec u((n*(n+1))/2, arma::fill::zeros);
u(j*n+i-((j+1)*j)/2) = 1.0;
arma::rowvec e_i(n, arma::fill::zeros);
e_i(i) = 1.0;
out += arma::kron(u, arma::kron(e_j, e_i));
}
}
return out;
}
For the matrix , one choice for this transformation is given by
: .
Notes
References
- {{Citation | last1=Magnus | first1=Jan R. | last2=Neudecker | first2=Heinz | title=The elimination matrix: some lemmas and applications | doi=10.1137/0601049 | year=1980 | journal= SIAM Journal on Algebraic and Discrete Methods| issn=0196-5212 | volume=1 | issue=4 | pages=422–449| url=http://repository.uvt.nl/id/ir-uvt-nl:oai:wo.uvt.nl:153210 }}.
- Jan R. Magnus and Heinz Neudecker (1988), Matrix Differential Calculus with Applications in Statistics and Econometrics, Wiley. {{ISBN|0-471-98633-X}}.
- Jan R. Magnus (1988), Linear Structures, Oxford University Press. {{ISBN|0-19-520655-X}}