On Thu, 31 Jan 2008, Sven Schreiber wrote:
I'm wondering why 'restrict' isn't possible after
GMM. Performing Wald-type
tests should not pose extra problems once we have the estimator and the
covariance matrix, right? Or am I missing something?
The same applies to mle. It seems quite clear to me that only the --wald
form should be allowed (in these cases, automatic estimation of the
restricted model would involve quite a bit of work).
I guess in principle this could be done, once we overcome a slight problem
of notation: we may adopt a convention by which b3 is $coeff[3] and so on,
like we do with, say, ols. Note, however, that this may be confusing in
some cases, since gmm & mle allow you to put your parameters under
arbitrary names. Example (admittedly a bit contrived):
<script>
nulldata 100
x = normal()
y = x + normal()
ols y 0 x
scalar b1 = 0
scalar b2 = 0
matrix W = I(2)
series e
gmm
e = y - b1 - b2*x
orthog e ; const
orthog e ; x
weights W
params b2 b1
end gmm
</script>
If, at this point, you were allowed to test a restriction for "b1 = 0",
you wouldn't be testing the hypothesis of zero intercept, but rather of
zero slope, since $coeff[1] is the _slope_, but comes first in the
ordering of the "params" statement.
On the other hand, a Wald-type statistic for restrictions of the kind $R
\theta = d$ can be computed quite easily, considering that after gmm you
_do_ have the $coeff and $vcv accessors ready to use. Example:
<script>
function Wald_type(matrix b, matrix V, matrix R, matrix d)
matrix num = R*b - d
matrix den = invpd(qform(R,V))
scalar wt = qform(num', den)
return scalar wt
end function
</script>
But I agree that having "restrict" work after gmm/mle would be nice.
Actually, if we decide to devote some time to "restrict", it'd be rather
cool to handle nonlinear constraints via the delta method. The problem is,
this would probably force us introduce a few backward-incompatible
changes.
Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche
r.lucchetti(a)univpm.it
http://www.econ.univpm.it/lucchetti