This function returns the (r c r c)
commutation matrix P such that
P vec(Y) = vec(Y'),
where Y is a (r c) matrix.
Usage
commat(r, c)
Arguments
r
Number of rows of Y.
c
Number of columns of Y.
Value
A sparse (r c r c) matrix, P.
References
Magnus, J.R., Neudecker, H. (2019), Matrix Differential Calculus
with Applications in Statistics and Econometrics, third edition, New York,
Wiley, pp. 54-55.