Tutorials › Multivariate Statistics (Graduate) › Duplication Matrices for Symmetric Matrices

Matrix Foundations for Inference · Tutorial 21 of 975

Duplication Matrices for Symmetric Matrices

Learn to build the duplication matrix by placing each lower-triangular coordinate in every corresponding position of the full vectorization.

Beginner 10 min read

What You'll Learn

  • State the column-major vec and lower-triangular vech conventions used to define the duplication matrix.
  • Construct each duplication-matrix column from the positions of a symmetric matrix entry.
  • Build and verify duplication matrices for matrices of orders two and three.
  • Prove the duplication matrix has full column rank and identify its Gram matrix.
  • Recognize errors involving off-diagonal duplication, diagonal entries, and coordinate ordering.

Why Symmetric Matrices Need a Duplication Matrix

A symmetric \(n\times n\) matrix contains \(n^2\) entries, but only \(n(n+1)/2\) of them can vary independently. The remaining entries repeat the off-diagonal values across the diagonal. The duplication matrix makes this relationship explicit: it converts the vector of independent entries into the full vectorization, without losing the positions or multiplicities of those entries.

This is a coordinate map, not a new matrix factorization. Its construction follows directly from the chosen order of the entries in \(\operatorname{vec}\) and \(\operatorname{vech}\). Because these conventions determine where each coordinate goes, they must be stated before writing down the matrix.

Definition and Coordinate Convention

Use column-major vectorization: \(\operatorname{vec}(S)\) lists the first column of \(S\), then the second column, and so on. Use lower-triangular half-vectorization in column order: list the entries in column 1 from row 1 down to row \(n\), then the entries in column 2 from row 2 down to row \(n\), continuing through the diagonal entry in column \(n\). Thus \(\operatorname{vech}(S)\) has \(n(n+1)/2\) entries.

Definition: For a symmetric matrix \(S\in\mathbb{R}^{n\times n}\), the duplication matrix \(D_n\) is the \(n^2\times n(n+1)/2\) matrix satisfying $$ \operatorname{vec}(S)=D_n\operatorname{vech}(S) $$ for every symmetric \(S\). Its columns follow the order of the coordinates in \(\operatorname{vech}(S)\). A diagonal-coordinate column has a 1 at the corresponding diagonal position of \(\operatorname{vec}(S)\). An off-diagonal-coordinate column has a 1 at each of the two positions occupied by that entry and its symmetric counterpart.

More precisely, consider the coordinate \(s_{ij}\) with \(i\geq j\). Its position in \(\operatorname{vech}(S)\) is $$ k(i,j)=\sum_{b=1}^{j-1}(n-b+1)+(i-j+1). $$ In \(\operatorname{vec}(S)\), matrix position \((a,b)\) appears at vector position \(a+(b-1)n\). Therefore column \(k(i,j)\) of \(D_n\) has a 1 in row \(i+(j-1)n\). If \(i>j\), it also has a 1 in row \(j+(i-1)n\). All other entries in that column are zero. If \(i=j\), these two position formulas refer to the same location, so the column has only one 1.

Equivalently, let \(E_{ij}\) denote the matrix with a 1 in position \((i,j)\) and zeros elsewhere. The column for \(s_{ij}\) is \(\operatorname{vec}(E_{ii})\) when \(i=j\), and \(\operatorname{vec}(E_{ij}+E_{ji})\) when \(i>j\). This description makes clear why an off-diagonal coordinate contributes twice to the full matrix while a diagonal coordinate contributes once.

Worked Example: Constructing \(D_2\)

Let \(S=\begin{pmatrix}a&b\\b&c\end{pmatrix}\). Under the stated conventions, $$ \operatorname{vech}(S)= \begin{pmatrix}a\\b\\c\end{pmatrix}, \qquad \operatorname{vec}(S)= \begin{pmatrix}a\\b\\b\\c\end{pmatrix}. $$

The first coordinate \(a=s_{11}\) appears in the first position of \(\operatorname{vec}(S)\), so the first column of \(D_2\) is \((1,0,0,0)^\mathsf{T}\). The second coordinate \(b=s_{21}=s_{12}\) appears in positions 2 and 3, so its column is \((0,1,1,0)^\mathsf{T}\). The last coordinate \(c=s_{22}\) appears in position 4. Hence $$ D_2= \begin{pmatrix} 1&0&0\\ 0&1&0\\ 0&1&0\\ 0&0&1 \end{pmatrix}. $$ Multiplying gives \(D_2(a,b,c)^\mathsf{T}=(a,b,b,c)^\mathsf{T}\), as required.

Building the Matrix One Column at a Time

Each column of \(D_n\) records the destination positions of exactly one independent entry. The nonzero pattern is therefore sparse and highly structured. Diagonal columns each have one nonzero entry; off-diagonal columns each have two. No row receives a contribution from two different columns, because each location in the full vectorization belongs to exactly one independent symmetric coordinate.

Worked Example: Locating Every Column of \(D_3\)

For $$ S= \begin{pmatrix} s_{11}&s_{12}&s_{13}\\ s_{12}&s_{22}&s_{23}\\ s_{13}&s_{23}&s_{33} \end{pmatrix}, $$ the coordinate order is \((s_{11},s_{21},s_{31},s_{22},s_{32},s_{33})^\mathsf{T}\). The full vectorization is $$ \operatorname{vec}(S)= (s_{11},s_{21},s_{31},s_{12},s_{22},s_{32},s_{13},s_{23},s_{33})^\mathsf{T}. $$

The six columns correspond, in order, to \(s_{11},s_{21},s_{31},s_{22},s_{32},s_{33}\). Their nonzero row positions in the full vector are, respectively, \(\{1\},\{2,4\},\{3,7\},\{5\},\{6,8\},\{9\}\). For instance, \(s_{31}=s_{13}\) occurs at vector position 3 in column 1 of \(S\), and position 7 in column 3 of \(S\). Thus $$ D_3= \begin{pmatrix} 1&0&0&0&0&0\\ 0&1&0&0&0&0\\ 0&0&1&0&0&0\\ 0&1&0&0&0&0\\ 0&0&0&1&0&0\\ 0&0&0&0&1&0\\ 0&0&1&0&0&0\\ 0&0&0&0&1&0\\ 0&0&0&0&0&1 \end{pmatrix}. $$ Each column has the specified nonzero positions, so multiplying this matrix by \(\operatorname{vech}(S)\) reproduces the displayed \(\operatorname{vec}(S)\).

Worked Example: Checking a Numeric Symmetric Matrix

Take \(S=\begin{pmatrix}2&-1&4\\-1&3&5\\4&5&6\end{pmatrix}\). Its half-vectorization is \((2,-1,4,3,5,6)^\mathsf{T}\). Using the rows of \(D_3\) in order gives $$ D_3 \begin{pmatrix}2\\-1\\4\\3\\5\\6\end{pmatrix} = \begin{pmatrix} 2\\-1\\4\\-1\\3\\5\\4\\5\\6 \end{pmatrix}. $$

The result lists the first column \((2,-1,4)^\mathsf{T}\), then the second column \((-1,3,5)^\mathsf{T}\), then the third column \((4,5,6)^\mathsf{T}\). In particular, the off-diagonal values \(-1\), \(4\), and \(5\) each appear twice, while the diagonal values appear once. This directly checks both the coordinate ordering and the duplication pattern.

Why the Definition Works and the Coordinates Are Recoverable

The defining identity follows by separating a symmetric matrix into contributions from its independent entries. The same column construction also establishes that \(D_n\) has full column rank. These facts are useful whenever a calculation is expressed in full matrix coordinates but the object being represented is symmetric.

Theorem: For every symmetric \(S\in\mathbb{R}^{n\times n}\), the column construction above satisfies \(\operatorname{vec}(S)=D_n\operatorname{vech}(S)\). Moreover, \(D_n\) has full column rank, and \(D_n^\mathsf{T}D_n\) is diagonal, with a 1 for each diagonal coordinate and a 2 for each strictly lower-triangular coordinate, in the \(\operatorname{vech}\) order.
1
Expand the matrix by independent entries.
Write \(S=\sum_{j=1}^n\sum_{i=j}^n s_{ij}A_{ij}\), where \(A_{ii}=E_{ii}\) and \(A_{ij}=E_{ij}+E_{ji}\) for \(i>j\). This holds because symmetry gives \(s_{ji}=s_{ij}\).
2
Vectorize the expansion.
Linearity of \(\operatorname{vec}\) gives \(\operatorname{vec}(S)=\sum_{j=1}^n\sum_{i=j}^n s_{ij}\operatorname{vec}(A_{ij})\). By construction, \(\operatorname{vec}(A_{ij})\) is exactly the column of \(D_n\) assigned to coordinate \(s_{ij}\). The sum is therefore \(D_n\operatorname{vech}(S)\), proving the identity.
3
Compute inner products of columns.
Each diagonal column has one 1, and each off-diagonal column has two 1s. Distinct columns have disjoint nonzero row positions because they correspond to distinct entries of the full matrix. Thus distinct columns have inner product zero, while each column's squared length is 1 for a diagonal coordinate and 2 for an off-diagonal coordinate.
4
Conclude full column rank.
The preceding inner products show that \(D_n^\mathsf{T}D_n\) is diagonal with strictly positive diagonal entries. If \(D_nx=0\), then \(0=x^\mathsf{T}D_n^\mathsf{T}D_nx\), a sum of positive weights times the squared coordinates of \(x\). Every coordinate of \(x\) must be zero, so the columns are linearly independent. \(\square\)

The theorem also gives an explicit way to reverse the map on vectors that really are vectorizations of symmetric matrices. Since \(D_n^\mathsf{T}D_n\) is invertible, the equation \(v=D_nu\) implies \(u=(D_n^\mathsf{T}D_n)^{-1}D_n^\mathsf{T}v\). For an off-diagonal coordinate, this operation averages the two repeated entries; for a diagonal coordinate, it keeps the single entry. This recovery statement applies to vectors in the range of \(D_n\), not to arbitrary vectors in \(\mathbb{R}^{n^2}\).

Common Mistakes and Practical Use

The duplication matrix is useful whenever symmetric matrices are represented using full vectorization, while calculations or parameters use only independent entries. It provides an exact bridge between those coordinate systems. The convention matters: changing the order in \(\operatorname{vech}\) changes the order of the columns, and changing the order in \(\operatorname{vec}\) changes the row positions. A matrix assembled under one convention cannot be used without adjustment under another.

  • Forgetting the repeated off-diagonal entry. A column for \(s_{ij}\), \(i>j\), must place a 1 at both \((i,j)\) and \((j,i)\) locations in \(\operatorname{vec}(S)\). A single 1 would omit half the symmetric matrix.
  • Doubling a diagonal entry. A diagonal coordinate appears once in the matrix, not twice. Its column has one 1, not a 2.
  • Mixing coordinate orders. Under column-major \(\operatorname{vec}\), positions are indexed by \(i+(j-1)n\). Row-major vectorization would give different row locations. Likewise, a different ordering of the lower triangle permutes the columns.
  • Confusing duplication with transposition. The commutation matrix rearranges the entries of a vectorized matrix to represent a transpose. The duplication matrix instead expands independent symmetric coordinates into the full vectorization.

A reliable construction procedure is to write the two coordinate lists first, then mark where each lower-triangular entry appears in the full list. This simple check catches most indexing errors before they propagate into a larger matrix calculation.

Check Your Understanding

Use the column-major \(\operatorname{vec}\) and lower-triangular \(\operatorname{vech}\) conventions stated above.

  1. What are the dimensions of \(D_4\), and how many entries in each of its columns are nonzero?
  2. For \(n=3\), which rows of \(D_3\) contain the two nonzero entries in the column for \(s_{32}\)?
  3. Explain why the diagonal entries of \(D_n^\mathsf{T}D_n\) are either 1 or 2.
  4. Why does full column rank imply that a symmetric matrix's half-vectorization can be recovered uniquely from its full vectorization?
  5. What changes in the duplication matrix if the order of coordinates in \(\operatorname{vech}\) is changed?
Clinical Biostats