commutation.matrix {matrixcalc} | R Documentation |
This function returns a square matrix of order p = m * n that, for an m by n matrix A, transforms vec(A) to vec(A') where prime denotes transpose.
commutation.matrix(m, n)
m |
integer row dimension |
n |
integer column dimension |
A numeric matrix.
If either argument is negative, then the function stops and displays an appropriate error mesage. If either argument is not an integer, then the function stops and displays an appropriate error mesage
Frederick Novomestky fnovomes@poly.edu
Magnus, J. R. and H. Neudecker (1999) Matrix Differential Calculus with Applications in Statistics and Econometrics, Second Edition, John Wiley.
K <- commutation.matrix( 3, 4 ) A <- matrix( seq( 1, 12, 1 ), nrow=3, byrow=TRUE ) vecA <- vec( A ) vecAt <- vec( t( A ) ) y <- K print( y )