hessian {numDeriv}R Documentation

Calculate Hessian Matrix

Description

Calculate a numerical approximation to the Hessian matrix of a function at a parameter value.

Usage

    hessian(func, x, method="Richardson", method.args=list(), ...)

    ## Default S3 method:
hessian(func, x, method="Richardson",
        method.args=list(eps=1e-4, d=0.1,
      zero.tol=sqrt(.Machine$double.eps/7e-7), r=4, v=2), ...)

Arguments

func

a function for which the first (vector) argument is used as a parameter vector.

x

the parameter vector first argument to func.

method

one of "Richardson" or "simple" indicating the method to use for the aproximation.

method.args

arguments passed to method. See grad. (Arguments not specified remain with their default values.)

...

an additional arguments passed to func. WARNING: None of these should have names matching other arguments of this function.

Details

The function hessian calculates an numerical aproximation to the n x n second derivative of a scalar real valued function with n-vector argument. It uses genD and extracts the second derivative.

Value

An n by n matrix of the Hessian of the function calculated at the point x.

See Also

jacobian, grad, genD


[Package numDeriv version 2010.11-1 Index]