MARSShessian.numerical {MARSS}R Documentation

Hessian Matrix via Numerical Approximation

Description

Calculates the Hessian of the log-likelihood function at the MLEs using either the fdHess function in the nlme package or the optim function. This is a utility function in the MARSS-package and is not exported. Use MARSShessian to access.

Usage

MARSShessian.numerical(MLEobj, fun=c("fdHess", "optim"))

Arguments

MLEobj

An object of class marssMLE. This object must have a $par element containing MLE parameter estimates from e.g. MARSSkem.

fun

The function to use for computing the Hessian. Options are 'fdHess' or 'optim'.

Details

Method fdHess uses fdHess from package nlme to numerically estimate the Hessian matrix (the matrix of partial 2nd derivatives) of the negative log-likelihood function with respect to the parameters. Method optim uses optim with hessian=TRUE and list(maxit=0) to ensure that the Hessian is computed at the values in the par element of the MLE object.

Value

The numerically estimated Hessian of the log-likelihood function at the maximum likelihood estimates.

Author(s)

Eli Holmes, NOAA, Seattle, USA.

See Also

MARSSharveyobsFI(), MARSShessian(), MARSSparamCIs()

Examples

dat <- t(harborSeal)
dat <- dat[c(2, 11), ]
MLEobj <- MARSS(dat)
MARSS:::MARSShessian.numerical(MLEobj)

[Package MARSS version 3.11.9 Index]