Learn R Programming

fastmatrix (version 0.5-7721)

vech: Vectorization the lower triangular part of a square matrix

Description

This function returns a vector obtained by stacking the lower triangular part of a square matrix.

Usage

vech(x)

Value

Let \(\bold{X}\) be a \(n\) by \(n\) matrix, then vech(\(\bold{X}\)) is a \(n(n+1)/2\)-dimensional vector.

Arguments

x

a square matrix.

Examples

Run this code
x <- matrix(rep(1:10, each = 10), ncol = 10)
x
y <- vech(x)
y

Run the code above in your browser using DataLab