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.

1 2 3 4 |

`x` |
vector or matrix |

`ncol,nrow` |
number of columns and rows for inverse of vech |

`byrow` |
flag for stacking row-wise or column-wise. Default is FALSE. |

Magnus, J.R. & Neudecker H.M. (1999) *Matrix
Differential Calculus with Applications in Statistics and
Econometrics (revised edition)*, Wiley & Sons. Chichester.

1 2 3 |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.