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

Description Usage Arguments Details Methods Examples

Description

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

Usage

1
2
3
4
5
6
7
8
## 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=(σ^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.

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

 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)

gmm4 documentation built on Dec. 6, 2019, 3:01 a.m.