aHess {dbd} | R Documentation |
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 |
x |
A numeric vector of observations appropriate for the model that
was fitted to produce |
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.
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.
Author(s)
Rolf Turner r.turner@auckland.ac.nz
See Also
Examples
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))