Learn R Programming

HyperbolicDist (version 0.6-5)

gigCheckPars: Check Parameters of the Generalized Inverse Gaussian Distribution

Description

Given a putative set of parameters for the generalized inverse Gaussian distribution, the functions checks if they are in the correct range, and if they correspond to the boundary cases.

Usage

gigCheckPars(Theta, ...)

Value

A list with components:

case

Whichever of 'error', 'gamma', invgamma, or 'normal' is identified by the function.

errMessage

An appropriate error message if an error was found, the empty string "" otherwise.

Arguments

Theta

Numeric. Putative parameter values for a generalized inverse Gaussian distribution.

...

Further arguments for calls to all.equal.

Author

David Scott d.scott@auckland.ac.nz

Details

The vector Theta takes the form c(lambda,chi,psi).

If either chi or psi is negative, an error is returned.

If chi is 0 (to within tolerance allowed by all.equal) then psi and lambda must be positive or an error is returned. If these conditions are satisfied, the distribution is identified as a gamma distribution.

If psi is 0 (to within tolerance allowed by all.equal) then chi must be positive and lambda must be negative or an error is returned. If these conditions are satisfied, the distribution is identified as an inverse gamma distribution.

If both chi and psi are positive, then the distribution is identified as a normal generalized inverse Gaussian distribution.

References

Paolella, Marc S. (2007) Intermediate Probability: A Computational Approach, Chichester: Wiley

See Also

dgig

Examples

Run this code
gigCheckPars(c(-0.5,5,2.5))      # normal
gigCheckPars(c(0.5,-5,2.5))      # error
gigCheckPars(c(0.5,5,-2.5))      # error
gigCheckPars(c(0.5,-5,-2.5))     # error
gigCheckPars(c(0.5,0,2.5))       # gamma
gigCheckPars(c(-0.5,0,2.5))      # error
gigCheckPars(c(0.5,0,0))         # error
gigCheckPars(c(-0.5,0,0))        # error
gigCheckPars(c(0.5,5,0))         # error
gigCheckPars(c(-0.5,5,0))        # invgamma

Run the code above in your browser using DataLab