Learn R Programming

pom (version 1.1)

F.2nd.deriv: Calculate the Hessian Matrix

Description

Compute numeric 2nd derivative (Hessian) of the function FUN()

Usage

F.2nd.deriv(pt, FUN, ...)

Arguments

pt
Vector input to FUN.
FUN
Name of a function to evaluate. Must return a scalar when FUN(pt) is called.
...
Optional Items to FUN()

Value

Returns the Hessian Matrix of the input function.

Details

This function is sourced by the siteocc function.

References

Casella, G., and Berger, R. L. (2002). Statistical inference, Duxbury Press.

See Also

weta.data siteocc

Examples

Run this code
F.test <- function(x){
    3*x[1]^3 + x[1]^2*x[2]^2 + x[2]^3 + x[1]^2*x[3]^4
}
F.2nd.deriv( c(2,3,4), F.test )

# Another Example using siteocc function to get standard errors.
data(weta.data) 
	
fit1 <- siteocc(~1, ~1, histories=weta.data$detection.histories) 
print(fit1)

Run the code above in your browser using DataLab