The vec (vector) operator takes a dxd matrix and stacks the columns into a single vector of length d2. The vech (vector half) operator takes a symmetric dxd 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.