Learn R Programming

VarianceGamma (version 0.4-2)

vgCalcRange: Range of a Variance Gamma Distribution

Description

Given the parameter vector param or the idividual parameter values \((c,\sigma,\theta,\nu)\) of a variance gamma distribution, this function determines the range outside of which the density function is negligible, to a specified tolerance. The parameterization used is the \((c,\sigma,\theta,\nu)\) one (see dvg). To use another parameterization, use vgChangePars.

Usage

vgCalcRange(vgC = 0, sigma = 1, theta = 0, nu = 1, 
    param = c(vgC, sigma, theta, nu), tol = 10^(-5), density = TRUE, ...)

Value

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

Arguments

vgC

The location parameter \(c\), default is 0.

sigma

The spread parameter \(\sigma\), default is 1, must be positive.

theta

The asymmetry parameter \(\theta\), default is 0.

nu

The shape parameter \(\nu\), default is 1, must be positive.

param

Specifying the parameters as a vector which takes the form c(vgC,sigma,theta,nu).

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.

Author

David Scott d.scott@auckland.ac.nz, Christine Yang Dong c.dong@auckland.ac.nz

Details

Users may either specify the values of the parameters individually or as a vector. If both forms are specifed but with different values, then the values specified by vector param will always overwrite the other ones.

The particular variance gamma distribution being considered is specified by the value of the parameter 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".

References

Seneta, E. (2004). Fitting the variance-gamma model to financial data. J. Appl. Prob., 41A:177--187. Kotz, S, Kozubowski, T. J., and Podgórski, K. (2001). The Laplace Distribution and Generalizations. Birkhauser, Boston, 349 p.

See Also

dvg, vgChangePars

Examples

Run this code

## Use the following rules for vgCalcRange when plotting graphs for dvg,
## ddvg and pvg.
## if nu < 2, use:
##   maxDens <- dvg(vgMode(param = c(vgC, sigma, theta, nu)),
##   param = c(vgC, sigma, theta, nu), log = FALSE)
##   vgRange <- vgCalcRange(param = c(vgC, sigma, theta, nu),
##     tol = 10^(-2)*maxDens, density = TRUE)

## if nu >= 2 and theta < 0, use:
##   vgRange <- c(vgC-2,vgC+6)
## if nu >= 2 and theta > 0, use:
##   vgRange <- c(vgC-6,vgC+2)
## if nu >= 2 and theta = 0, use:
##   vgRange <- c(vgC-4,vgC+4)

param <- c(0,0.5,0,0.5)
maxDens <- dvg(vgMode(param = param), param = param)
vgRange <- vgCalcRange(param = param, tol = 10^(-2)*maxDens)
vgRange
curve(dvg(x, param = param), vgRange[1], vgRange[2])
curve(dvg(x, param = param), vgRange[1], vgRange[2])

param <- c(2,2,0,3)
vgRange <- c(2-4,2+4)
vgRange
curve(dvg(x, param = param), vgRange[1], vgRange[2])
if (FALSE) vgCalcRange(param = param, tol = 10^(-3), density = FALSE)

Run the code above in your browser using DataLab