Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

K.matrix

K Matrix


Description

This function returns a square matrix of order p = r * c that, for an r by c matrix A, transforms vec(A) to vec(A') where prime denotes transpose.

Usage

K.matrix(r, c = r)

Arguments

r

a positive integer row dimension

c

a positive integer column dimension

Details

The r \times c matrices {\bf{H}}{}_{i,j} constructed by the function H.matrices are combined using direct product to generate the commutation product with the formula {{\bf{K}}_{r,c}} = ∑\limits_{i = 1}^r {∑\limits_{j = 1}^c {≤ft( {{{\bf{H}}_{i,j}} \otimes {{{\bf{H'}}}_{i,j}}} \right)} }

Value

An order ≤ft( {r\;c} \right) matrix.

Note

If either argument is less than 2, 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 (1979). The commutation matrix: some properties and applications, The Annals of Statistics, 7(2), 381-394.

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

See Also

Examples

K <- K.matrix( 3, 4 )
A <- matrix( seq( 1, 12, 1 ), nrow=3, byrow=TRUE )
vecA <- vec( A )
vecAt <- vec( t( A ) )
y <- K %*% vecA
print( y )
print( vecAt )

matrixcalc

Collection of functions for matrix calculations

v1.0-3
GPL (>= 2)
Authors
Frederick Novomestky <fnovomes@poly.edu>
Initial release
2012-09-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.