Fits a variance gamma distribution to data. Displays the histogram,
log-histogram (both with fitted densities), Q-Q plot and P-P plot for the
fit which has the maximum likelihood.
Data vector for vgFit. Object of class
"vgFit" for print.vgFit and plot.vgFit.
freq
A vector of weights with length equal to length(x).
breaks
Breaks for histogram, defaults to those generated by
hist(x, right = FALSE, plot = FALSE).
paramStart
A user specified starting parameter vector param taking
the form c(vgC,sigma,theta,nu).
startMethod
Method used by vgFitStart in calls to
optim, default is "Nelder-Mead". See Details.
startValues
Code giving the method of determining starting
values for finding the maximum likelihood estimate of param, default method
is "SL". See Details.
method
Different optimisation methods to consider, default is
"Nelder-Mead". See Details.
hessian
Logical. If TRUE the value of the hessian is
returned.
plots
Logical. If FALSE suppresses printing of the
histogram, log-histogram, Q-Q plot and P-P plot.
printOut
Logical. If FALSE suppresses printing of
results of fitting.
controlBFGS
A list of control parameters for optim when using
the "BFGS" optimisation.
controlNM
A list of control parameters for optim
when using the "Nelder-Mead" optimisation.
maxitNLM
A positive integer specifying the maximum number of
iterations when using the "nlm" optimisation.
digits
Desired number of digits when the object is printed.
which
If a subset of the plots is required, specify a subset of
the numbers 1:4.
plotTitles
Titles to appear above the plots.
ask
Logical. If TRUE, the user is asked before
each plot, see par(ask = .).
...
Passes arguments to par, hist,
logHist, qqhyperb and pphyperb.
Details
startMethod can be either "BFGS" or
"Nelder-Mead".
startValues can be one of the following:
"US"User-supplied.
"SL"Based on a fitted skew-Laplace distribution.
"MoM"Method of moments.
For the details concerning the use of paramStart,
startMethod, and startValues, see
vgFitStart.
The three optimisation methods currently available are:
"BFGS"Uses the quasi-Newton method "BFGS" as
documented in optim.
"Nelder-Mead"Uses an implementation of the Nelder and
Mead method as documented in optim.
"nlm"Uses the nlm function in R.
For details of how to pass control information for optimisation using
optim and nlm, see optim and
nlm.
When method = "Nelder-Mead" is used, very rarely, it would return an
error message of "error in optim(paramStart,...)", use method = "BFGS"
or method = "nlm" instead in that case.
When method = "nlm" is used, warnings may be produced. These do
not appear to be a problem.
Value
A list with components:
param
A vector giving the maximum likelihood estimate of
param, as (c,sigma,theta,nu).
maxLik
The value of the maximised log-likelihood.
hessian
If hessian was set to TRUE, the value
of the hessian. Not present otherwise.
method
Optimisation method used.
conv
Convergence code. See the relevant documentation (either
optim or nlm) for details on
convergence.
iter
Number of iterations of optimisation routine.
obs
The data used to fit the hyperbolic distribution.
obsName
A character string with the actual obs argument
name.
paramStart
Starting value of param returned by call to
vgFitStart.
svName
Descriptive name for the method finding start values.