Learn R Programming

matrixcalc (version 1.0-6)

vech: Vectorize a matrix

Description

This function returns a stack of the lower triangular matrix of a square matrix as a matrix with 1 column and n * ( n + 1 ) / 2 rows

Usage

vech(x)

Value

A matrix with \(\frac{1}{2}n\left( {n + 1} \right)\) rows and one column.

Arguments

x

a matrix

Author

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

is.square.matrix

Examples

Run this code
x <- matrix( seq( 1, 16, 1 ), nrow=4, byrow=TRUE )
print( x )
y <- vech( x )
print( y )

Run the code above in your browser using DataLab