Given the parameter vector param
or the idividual parameter values
dvg
). To use another parameterization, use
vgChangePars
.
vgCalcRange(vgC = 0, sigma = 1, theta = 0, nu = 1,
param = c(vgC, sigma, theta, nu), tol = 10^(-5), density = TRUE, ...)
A two-component vector giving the lower and upper ends of the range.
The location parameter
The spread parameter
The asymmetry parameter
The shape parameter
Specifying the parameters as a vector which takes the form
c(vgC,sigma,theta,nu)
.
Tolerance.
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
.
David Scott d.scott@auckland.ac.nz, Christine Yang Dong c.dong@auckland.ac.nz
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
".
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.
dvg
, vgChangePars
## 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