vec, vech, invvec, invvech {ks}R Documentation

Vector and vector half operators

Description

The vec (vector) operator takes a d x d matrix and stacks the columns into a single vector of length d^2. The vech (vector half) operator takes a symmetric d x d matrix and stacks the lower triangular half into a single vector of length d(d+1)/2.

The functions invvec and invvech are the inverses of vec and vech i.e. they form matrices from vectors.

Usage

vec(x)
vech(x)
invvec(x)
invvech(x)

Arguments

x vector or matrix

References

Wand, M.P. & Jones, M.C. (1995) Kernel Smoothing. Chapman & Hall. London.

Examples

x <- matrix(1:9, nrow=3, ncol=3)
vec(x)
vech(x)
invvec(vec(x))
invvech(vech(x))

[Package ks version 1.4.9 Index]