Learn R Programming

dbd (version 0.0-22)

aHess: Analytic hessian.

Description

Compute the hessian of the negative log likelihood of a db or beta binomial distribution from an analytic expression for this quantity.

Usage

aHess(object,x)

Arguments

object

An object of class "mleDb" or "mleBb" as returned by the function mleDb() or the function mleBb().

x

A numeric vector of observations appropriate for the model that was fitted to produce object. Needed only if object is of class "mleBb"; the hessian for the db distribution depends only upon the parameters and not upon the data.

Value

A two-by-two positive definite (with any luck!) numeric matrix. Its inverse is an estimate of the covariance matrix of the parameter estimates.

Details

This function is essentially the same as the finfo() functions and differs from it only in that it is designed to act up "mleDb" or "mleBb" objects, from which (estimates of) the relevant parameters are extracted.

See Also

nHess() finfo() mleDb()

Examples

Run this code
# NOT RUN {
X   <- hmm.discnp::SydColDisc
X$y <- as.numeric(X$y)
X   <- split(X,f=with(X,interaction(locn,depth)))
x   <- X[[19]]$y
fit <- mleDb(x, ntop=5)
H   <- aHess(fit)
print(solve(H)) # Equal to ...
print(vcov(fit))
X     <- hrsRcePred
top1e <- X[X$sbjType=="Expert","top1"]
fit   <- mleBb(top1e,size=10)
H     <- aHess(fit,x=top1e)
print(solve(H)) # Equal to ...
print(vcov(fit))
# }

Run the code above in your browser using DataLab