Hello all,
I am writing a -gmm- moment-evaluator program. I want to get (an estimate of) Ω in the GMM sandwich formula in order to manually construct the variance-covariance matrix. That is, I want the (sample version of) Ω found in (GTWG)-1GTWΩWTG(GTWTG)-1, where Ω=E[g(...)g(...)T] is the expected value of the outer product of the moment function vector with itself. Is there a nice way to do this in Stata with some sort of command or something similar?
(I know I can supply analytical derivatives to get the analytical sample vcov matrix, and I've asked an earlier question related to this: https://www.statalist.org/forums/for...-observation-i. However, my G turns out to have a "nice" formula, so it's probably more efficient to directly construct the vcov matrix. Thus, I'm interested in whether it's possible to get Ω from some sort of built-in functionality because that allows a user to easily change the assumed structure of Ω through the -vce()- option.)
I am writing a -gmm- moment-evaluator program. I want to get (an estimate of) Ω in the GMM sandwich formula in order to manually construct the variance-covariance matrix. That is, I want the (sample version of) Ω found in (GTWG)-1GTWΩWTG(GTWTG)-1, where Ω=E[g(...)g(...)T] is the expected value of the outer product of the moment function vector with itself. Is there a nice way to do this in Stata with some sort of command or something similar?
(I know I can supply analytical derivatives to get the analytical sample vcov matrix, and I've asked an earlier question related to this: https://www.statalist.org/forums/for...-observation-i. However, my G turns out to have a "nice" formula, so it's probably more efficient to directly construct the vcov matrix. Thus, I'm interested in whether it's possible to get Ω from some sort of built-in functionality because that allows a user to easily change the assumed structure of Ω through the -vce()- option.)
Comment