# bread: Bread for sandwiches In gmm: Generalized Method of Moments and Generalized Empirical Likelihood

## Description

Computes the bread of the sandwich covariance matrix

## Usage

 1 2 3 4 5 6 ## S3 method for class 'gmm' bread(x, ...) ## S3 method for class 'gel' bread(x, ...) ## S3 method for class 'tsls' bread(x, ...) 

## Arguments

 x A fitted model of class gmm or gel. ... Other arguments when bread is applied to another class object

## Details

When the weighting matrix is not the optimal one, the covariance matrix of the estimated coefficients is: (G'WG)^{-1} G'W V W G(G'WG)^{-1}, where G=d\bar{g}/dθ, W is the matrix of weights, and V is the covariance matrix of the moment function. Therefore, the bread is (G'WG)^{-1}, which is the second derivative of the objective function.

The method if not yet available for gel objects.

## Value

A k \times k matrix (see details).

## References

Zeileis A (2006), Object-oriented Computation of Sandwich Estimators. Journal of Statistical Software, 16(9), 1–16. URL http://www.jstatsoft.org/v16/i09/.

## 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 # See \code{\link{gmm}} for more details on this example. # With the identity matrix # bread is the inverse of (G'G) n <- 1000 x <- rnorm(n, mean = 4, sd = 2) g <- function(tet, x) { m1 <- (tet[1] - x) m2 <- (tet[2]^2 - (x - tet[1])^2) m3 <- x^3 - tet[1]*(tet[1]^2 + 3*tet[2]^2) f <- cbind(m1, m2, m3) return(f) } Dg <- function(tet, x) { jacobian <- matrix(c( 1, 2*(-tet[1]+mean(x)), -3*tet[1]^2-3*tet[2]^2,0, 2*tet[2], -6*tet[1]*tet[2]), nrow=3,ncol=2) return(jacobian) } res <- gmm(g, x, c(0, 0), grad = Dg,weightsMatrix=diag(3)) G <- Dg(res\$coef, x) bread(res) solve(crossprod(G)) 

### Example output

Loading required package: sandwich
[,1]        [,2]
[1,]  0.03816038 -0.04766204
[2,] -0.04766204  0.05995436
[,1]        [,2]
[1,]  0.03816038 -0.04766204
[2,] -0.04766204  0.05995436


gmm documentation built on March 18, 2018, 2:30 p.m.