Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: RE: RE: st: kronecker product - matsize

From   "Martin Halla" <>
To   <>
Subject   RE: RE: RE: st: kronecker product - matsize
Date   Tue, 01 Feb 2005 16:17:02 +0100

thank you very much david,

martin h

Martin HALLA 
Department of Economics
Johannes Kepler University Linz
Altenbergerstr. 69
A-4040 Linz, Austria 

Tel.: +43-732-2468-8219
Fax: +43-732-2468-2-8219

>>> 02/01/05 4:01 pm >>>
Martin Halla <> wrote that - matrix glsaccum- only
part of the problem.  Martin needs to compute

matrix B = inv((z*inv(z'z)*z'x)'*(inv(sigma)#In)*x) *	///
		(z*inv(z'z)*z'x)'*(inv(sigma) # In)*y

which is difficult since z is N by p, x is N by k and y is N by 1.

Martin used -matrix accum- to compute



	matrix B = inv((z*inv(ZZ)*ZX)'*(inv(sigma)#In)*x) *	///
		(z*inv(ZZ)*ZX)'*(inv(sigma) # In)*y


	W = (z*inv(ZZ)*ZX) 

cause the problem to become

	B = inv(W'*(inv(sigma)#In)x)*W'(inv(sigma)#In)*y

which could computed using -matrix glsaccum-, if we had the variables
make up the matrix W.

To obtain W, Martin can let each column of inv(ZZ)*ZX be vector that we
call h.  Martin can then transpose h, so it is now a row vector, make
row names of h equal to names of the variables in z and then use
score- to compute a new variable.  After doing this for each column of
inv(ZZ)*ZX, he will have created the variables in W

With the W variables in hand, Martin now needs to compute



which can be computed using -matrix glsaccum-.  (To get
from -matrix glsaccum- include the W and the x variables in the varlist
then grab the upper-right block of the resulting matrix.)


*   For searches and help try:
*   For searches and help try:

© Copyright 1996–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index