duplication.matrix {matrixcalc} | R Documentation |
This function returns a matrix with n * n rows and n * ( n + 1 ) / 2 columns that transforms vech(A) to vec(A) where A is a symmetric n by n matrix.
duplication.matrix(n=1)
n |
Row and column dimension |
A matrix.
If the argument is less than or equal to zero, the function displays an error message and stops. If the argument is not an integer, the function displays an error message and stops.
Frederick Novomestky fnovomes@poly.edu, Kurt Hornik Kurt.Hornik@wu-wien.ac.at
Magnus, J. R. and H. Neudecker (1999) Matrix Differential Calculus with Applications in Statistics and Econometrics, Second Edition, John Wiley.
D <- duplication.matrix( 4 ) A <- matrix( seq( 1, 16, 1 ), nrow=4, byrow=TRUE ) vecA <- vec( A ) vechA<- vech( A ) y <- D print( y ) print( vecA )