meatGmm-methods {gmm4} | R Documentation |
meatGmm
in Package gmm4 ~~It computes the meat in the sandwich representation of the covariance matrix of the GMM estimator.
## S4 method for signature 'gmmfit' meatGmm(object, robust=FALSE) ## S4 method for signature 'sgmmfit' meatGmm(object, robust=FALSE) ## S4 method for signature 'tsls' meatGmm(object, robust=FALSE)
object |
GMM fit object |
robust |
If |
If robust=FALSE
, then the meat is G'V^{-1}G, where
G and V are respectively the sample mean of the derivatives
and the covariance matrix of the moment conditions. If it is
TRUE
, the meat is G'WVWG, where W is the weighting
matrix.
For tsls
objects, the function makes use of the QR representation
of the weighting matrix. It is simply possible to get the meat in a more
stable way. In that case, W=(σ^2Z'Z/n)^{-1}. If robust
is FALSE, V
is assumed to be σ^2Z'Z/n which is the
inverse of the bread
. Therefore, a sandwich covariance matrix
with robust=FALSE
will result in a non-sandwich matrix.
For sgmmfit
, the covariance is for the vectorized coefficient
vector of all equations.
signature(object = "gmmfit")
General GMM fit.
signature(object = "tsls")
For model estimated by two-stage least squares.
signature(object = "sgmmfit")
For system of equations.
data(simData) theta <- c(beta0=1,beta1=2) model1 <- gmmModel(y~x1, ~z1+z2, data=simData) res <- modelFit(model1) meatGmm(res) ## It is a slightly different because the weighting matrix ## is computed using the first step estimate and the covariance ## matrix of the moment conditions is based on the final estimate. ## They should, however, be asymptotically equivalent. meatGmm(res, robust=TRUE) ## TSLS res2 <- tsls(model1) ## Robust meat meatGmm(res2, TRUE) ## It makes no difference is the model is assumed iid model2 <- gmmModel(y~x1, ~z1+z2, data=simData, vcov="iid") res2 <- tsls(model2) meatGmm(res2, FALSE) meatGmm(res2, TRUE)