nigHessian | R Documentation |
Calculates the Hessian of a function, either exactly or approximately. Used to obtaining the information matrix for maximum likelihood estimation.
nigHessian(x, param, hessianMethod = "tsHessian",
whichParam = 1:5, ...)
x |
Data vector. |
param |
The maximum likelihood estimates parameter vector of the
normal inverse Gaussian distribution. The normal inverse Gaussian
distribution has the same sets of parameterizations as the hyperbolic
distribution.There are five different sets of
parameterazations can be used in this function, the first four sets
are listed in |
hessianMethod |
Only the approximate method ( |
whichParam |
Numeric. A number between 1 to 5 indicating which
set of the parameterization is the specified value in argument
|
... |
Values of other parameters of the function |
The approximate Hessian is obtained via a call to tsHessian
from the package DistributionUtils
. summary.nigFit
calls the function nigHessian
to calculate the Hessian matrix
when the argument hessian = TRUE
.
nigHessian
gives the approximate or exact Hessian matrix for
the data vector x
and the estimated parameter vector
param
.
David Scott d.scott@auckland.ac.nz, Christine Yang Dong c.dong@auckland.ac.nz
### Calculate the exact Hessian using nigHessian:
param <- c(2, 2, 2, 1)
dataVector <- rnig(500, param = param)
fit <- nigFit(dataVector, method = "BFGS")
coef=coef(fit)
nigHessian(x=dataVector, param=coef, hessianMethod = "tsHessian",
whichParam = 2)
### Or calculate the exact Hessian using summary.nigFit method:
### summary(fit, hessian = TRUE)
## Calculate the approximate Hessian:
summary(fit, hessian = TRUE, hessianMethod = "tsHessian")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.