commutation {MVT} | R Documentation |
This function returns a commutation matrix of order n
which transforms,
for an n
by n
matrix x
, vec(x)
into vec(t(x))
.
commutation(n = 2)
n |
a non-negative integer. |
Returns an square commutation matrix of order n^2 .
Magnus, J.R., and Neudecker, H. (1979). The commutation matrix: some properties and applications. The Annals of Statistics 7, 381-394.
Magnus, J.R., and Neudecker, H. (1999). Matrix Differential Calculus with Applications in Statistics and Econometrics, 2nd Edition. Wiley, New York.
a <- matrix(1:9, ncol = 3) kmat <- commutation(nrow(a)) vec <- as.vector(a) ## vectorization of t(a): kmat %*% vec