A couple of extensions to the "gmm" command are now in git
(snapshots will follow).
1) The doc for the "orthog" keyword (which defines an orthogonality
condition) states that the terms on the left and right of the
semicolon can be scalars, matrices or lists, but up till now a list
could only be given as a _named_ list. Now a list can be given in
"raw" form, as the space-separated names of two or more series. This
is convenient in some contexts.
2) Up till now parameters given in connection with the "params"
keyword could only be scalars or vectors. Now a general matrix is
acceptable. The script below illustrates this usage, with a
comparison of estimation of a (very simple) two-equation system via
OLS and GMM.
<hansl>
set verbose off
nulldata 100
T = $nobs
k = 3
n = 2
matrix X = mnormal(T, k)
matrix Y = mnormal(T, n)
# OLS
matrix U1 = {}
matrix B1 = mols(Y, X, &U1)
# GMM
matrix B2 = zeros(k, n)
matrix U2 = zeros(T, n)
matrix W = I(n*k)
gmm
U2 = Y - X*B2
orthog U2 ; X
weights W
params B2
end gmm
print B1 B2
eval max(abs(U1 - U2))
</hansl>
Allin Cottrell