Hi,
I just found out that gretl's vec() and vech() functions have an
important difference: As duly documented, vec() stacks the columns (as
expected), but a little bit to my surprise vech() stacks the (relevant
parts of the) rows of the input. The latter property is not very
explicitly documented. (It just talks about the upper triangle of the
matrix, which at least is a hint in that direction.)
So basically to get the Wikipedia-style convention of the vech function
(
https://en.wikipedia.org/wiki/Vectorization_(mathematics)#Half-vectorization)
we need to work on the transpose, vech(m').
This message just serves to share this "discovery". I'm not saying we
should change vech's behavior because that would break too much stuff.
But maybe a more explicit note should be added to the documentation.
(You may wonder why this matters at all, given that the input typically
should be symmetric; but I had to work with some code that just fills
the lower triangle of a matrix and then expands this to a symmetric
matrix. So the input there wasn't symmetric, by design.)
thanks
sven