commutation.matrix {matrixcalc}R Documentation

Commutation matrix for m by n numeric matrices

Description

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.

Usage

commutation.matrix(m, n)

Arguments

m

integer row dimension

n

integer column dimension

Value

A numeric matrix.

Note

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

Author(s)

Frederick Novomestky fnovomes@poly.edu

References

Magnus, J. R. and H. Neudecker (1999) Matrix Differential Calculus with Applications in Statistics and Econometrics, Second Edition, John Wiley.

See Also

vec, vech

Examples

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 )

[Package matrixcalc version 1.0-1 Index]