Last data update: 2014.03.03

R: Range of a Generalized Inverse Gaussian Distribution
gigCalcRangeR Documentation

Range of a Generalized Inverse Gaussian Distribution

Description

Given the parameter vector param of a generalized inverse Gaussian distribution, this function determines the range outside of which the density function is negligible, to a specified tolerance. The parameterization used is the (chi, psi) one (see dgig). To use another parameterization, use gigChangePars.

Usage

gigCalcRange(chi = 1, psi = 1, lambda = 1,
             param = c(chi, psi, lambda),
             tol = 10^(-5), density = TRUE, ...)

Arguments

chi

A shape parameter that by default holds a value of 1.

psi

Another shape parameter that is set to 1 by default.

lambda

Shape parameter of the GIG distribution. Common to all forms of parameterization. By default this is set to 1.

param

Value of parameter vector specifying the generalized inverse Gaussian distribution.

tol

Tolerance.

density

Logical. If TRUE, the bounds are for the density function. If FALSE, they should be for the probability distribution, but this has not yet been implemented.

...

Extra arguments for calls to uniroot.

Details

The particular generalized inverse Gaussian distribution being considered is specified by the value of the parameter value param.

If density = TRUE, the function gives a range, outside of which the density is less than the given tolerance. Useful for plotting the density. Also used in determining break points for the separate sections over which numerical integration is used to determine the distribution function. The points are found by using uniroot on the density function.

If density = FALSE, the function returns the message: "Distribution function bounds not yet implemented".

Value

A two-component vector giving the lower and upper ends of the range.

Author(s)

David Scott d.scott@auckland.ac.nz

References

J<c3><b6>rgensen, B. (1982). Statistical Properties of the Generalized Inverse Gaussian Distribution. Lecture Notes in Statistics, Vol. 9, Springer-Verlag, New York.

See Also

dgig, gigChangePars

Examples

param <- c(2.5, 0.5, 5)
maxDens <- dgig(gigMode(param = param), param = param)
gigRange <- gigCalcRange(param = param, tol = 10^(-3) * maxDens)
gigRange
curve(dgig(x, param = param), gigRange[1], gigRange[2])
## Not run: gigCalcRange(param = param, tol = 10^(-3), density = FALSE)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(GeneralizedHyperbolic)
Loading required package: DistributionUtils
Loading required package: RUnit
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/GeneralizedHyperbolic/gigCalcRange.Rd_%03d_medium.png", width=480, height=480)
> ### Name: gigCalcRange
> ### Title: Range of a Generalized Inverse Gaussian Distribution
> ### Aliases: gigCalcRange
> ### Keywords: distribution
> 
> ### ** Examples
> 
> param <- c(2.5, 0.5, 5)
> maxDens <- dgig(gigMode(param = param), param = param)
> gigRange <- gigCalcRange(param = param, tol = 10^(-3) * maxDens)
> gigRange
[1]  1.400674 66.709821
> curve(dgig(x, param = param), gigRange[1], gigRange[2])
> ## Not run: gigCalcRange(param = param, tol = 10^(-3), density = FALSE)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>