bread.maxLik {maxLik}R Documentation

Bread for Sandwich Estimator

Description

Extracting an estimator for the ‘bread’ of the sandwich estimator, see bread.

Usage

## S3 method for class 'maxLik'
bread( x, ... )

Arguments

x

an object of class maxLik.

...

further arguments (currently ignored).

Value

Matrix, the inverse of the expectation of the second derivative (Hessian matrix) of the log-likelihood function with respect to the parameters, usually equal to the variance covariance matrix of the parameters times the number of observations.

Warnings

The sandwich package must be loaded before this method can be used.

This method works only if maxLik was called with argument grad equal to a gradient function or (if no gradient function is specified) argument logLik equal to a log-likelihood function that return the gradients or log-likelihood values, respectively, for each observation.

Author(s)

Arne Henningsen

See Also

bread, maxLik.

Examples

## ML estimation of exponential duration model:
t <- rexp(100, 2)
loglik <- function(theta) log(theta) - theta*t

## Estimate with numeric gradient and hessian
a <- maxLik(loglik, start=1 )

# Extract the "bread"
library( sandwich )
bread( a )

all.equal( bread( a ), vcov( a ) * nObs( a ) )

[Package maxLik version 1.1-0 Index]