Description Usage Arguments Details Value Author(s) Examples
View source: R/hyperbHessian.R
Calculates the Hessian of a function, either exactly or approximately. Used to obtain the information matrix for maximum likelihood estimation.
1 2 3  hyperbHessian(x, param, hessianMethod = c("exact", "tsHessian"),
whichParam = 1:5)
sumX(x, mu, delta, r, k)

x 
Data vector. 
param 
The maximum likelihood estimates parameter vector of the
hyperbolic distribution. There are five different sets of
parameterazations can be used in this function, the first four sets
are listed in 
hessianMethod 
Two methods are available to calculate the
Hessian exactly ( 
whichParam 
Numeric. A number between 1 to 5 indicating which
set of the parameterization is the specified value in argument

mu 
Value of the parameter mu of the hyperbolic distribution. 
delta 
Value of the parameter delta of the hyperbolic distribution. 
r 
Parameter used in calculating a cumulative sum of the data vector x. 
k 
Parameter used in calculating a cumulative sum of the data vector x. 
The formulae for the exact Hessian are derived by Maple
software with some simplifications. For now, the exact Hessian can
only be obtained based on the first, second or the last
parameterization sets. The approximate Hessian is obtained via a
call to tsHessian
from the package DistributionUtils
.
summary.hyperbFit
calls the function hyperbHessian
to
calculate the Hessian matrix when the argument hessian =
TRUE
.
hyperbHessian
gives the approximate or exact Hessian matrix for
the data vector x
and the estimated parameter vector
param
. sumX
is a sum term used in calculating the exact
Hessian. It is called by hyperbHessian
when the argument
hessianMethod = "exact"
. It is not expected to be called
directly by users.
David Scott [email protected], Christine Yang Dong [email protected]
1 2 3 4 5 6 7 8 9 10 11 12 13 14  ### Calculate the exact Hessian using hyperbHessian:
param < c(2, 2, 2, 1)
dataVector < rhyperb(500, param = param)
fit < hyperbFit(dataVector, method = "BFGS")
coef < coef(fit)
hyperbHessian(x = dataVector, param = coef, hessianMethod = "exact",
whichParam = 2)
### Or calculate the exact Hessian using summary.hyperbFit 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.