Description Usage Arguments Details Methods Examples
It computes the meat in the sandwich representation of the covariance matrix of the GMM estimator.
1 2 3 4 5 6 7 8 |
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.