Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: cholesky vs matpowersym for FGLS transformation in Mata

From   Bert Lloyd <>
To   statalist <>
Subject   st: cholesky vs matpowersym for FGLS transformation in Mata
Date   Tue, 24 Apr 2012 21:50:22 -0400

Dear Statalist,

I have an application for which I need to conduct FGLS estimation "by
hand", that is, transform both the y and X variables so that their
regression cross-products are weighted by an FGLS weighting matrix

That is, my ultimate goal is a regression of the form


but for various reasons I need to compute this as a regression of
tilde_y on tilde_X, where either

tilde_X = Omega^(-1/2)*X
tilde_y = Omega^(-1/2)*X


tilde_X = L'*X
tilde_y = L'*y
L*L' = Omega^(-1), i.e L is the cholesky decomposition of Omega^(-1).

So, it seems that I could do either of the following
tilde_X = matpowersym(invsym(Omega),0.5)
tilde_X = cholesky(invsym(Omega))'*X
and similarly for y, and the ultimate result ought to be the same.

Is there any reason to prefer one method over the other? Are there
important tradeoffs between the two?

Given that a google search for
stata matpowersym
returns 107 hits, while a search for
stata cholesky
returns 12,500 hits, I am inclined to use the Cholesky method, but
would like to make a more informed choice if possible.

Many thanks,


PS - I am aware of the matrix glsaccum function in Stata, however this
is not suitable for my context, essentially because the weighting
matrix is not constant across groups.
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index