Learn R Programming

GeneralizedHyperbolic (version 0.8-4)

gigHessian: Calculate Two-Sided Hessian for the Generalized Inverse Gaussian Distribution

Description

Calculates the Hessian of a function, either exactly or approximately. Used to obtaining the information matrix for maximum likelihood estimation.

Usage

gigHessian(x, param, hessianMethod = "tsHessian",
           whichParam = 1)

Arguments

x

Data vector.

param

The maximum likelihood estimates parameter vector of the generalized inverse Gaussian distribution. There are five different sets of parameterazations can be used in this function, the first four sets are listed in gigChangePars and the last set is the log scale of the first set of the parameterization, i.e., mu,log(delta),Pi,log(zeta).

hessianMethod

Only the approximate method ("tsHessian") has actually been implemented so far.

whichParam

Numeric. A number between indicating which parameterization the argument param relates to. Only parameterization 1 is available so far.

Value

gigHessian gives the approximate Hessian matrix for the data vector x and the estimated parameter vector param.

Details

The approximate Hessian is obtained via a call to tsHessian from the package DistributionUtils. summary.gigFit calls the function gigHessian to calculate the Hessian matrix when the argument hessian = TRUE.

Examples

Run this code
# NOT RUN {
### Calculate the approximate Hessian using gigHessian:
param <- c(1,1,1)
dataVector <- rgig(500, param = param)
fit <- gigFit(dataVector)
coef <- coef(fit)
gigHessian(x = dataVector, param = coef, hessianMethod = "tsHessian",
              whichParam = 1)

### Or calculate the approximate Hessian using summary.gigFit method:
summary(fit, hessian = TRUE)
# }

Run the code above in your browser using DataLab