meatGmm-methods: ~~ Methods for Function 'meatGmm' in Package 'momentfit' ~~

meatGmm-methodsR Documentation

~~ Methods for Function meatGmm in Package momentfit ~~

Description

It computes the meat in the sandwich representation of the covariance matrix of the GMM estimator.

Usage

## 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)

Arguments

object

GMM fit object

robust

If TRUE, the meat is robust to the failure of the assumption that the weighting matrix is the inverse of the covariance matrix of the moment conditions. (see details)

Details

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=(\sigma^2Z'Z/n)^{-1}. If robust is FALSE, V is assumed to be \sigma^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.

Methods

signature(object = "gmmfit")

General GMM fit.

signature(object = "tsls")

For model estimated by two-stage least squares.

signature(object = "sgmmfit")

For system of equations.

Examples

data(simData)
theta <- c(beta0=1,beta1=2)
model1 <- momentModel(y~x1, ~z1+z2, data=simData)

res <- gmmFit(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 <- momentModel(y~x1, ~z1+z2, data=simData, vcov="iid")
res2 <- tsls(model2)
meatGmm(res2, FALSE)
meatGmm(res2, TRUE)



momentfit documentation built on Sept. 20, 2023, 3:01 a.m.