Fit the Skew Hyperbolic Student tDistribution to Data
Description
Fits a skew hyperbolic tdistribution to given data. Displays the histogram, loghistogram (both with fitted densities), QQ plot and PP plot for the fit which has maximum likelihood.
Usage
1 2 3 4 5 6 7 8 9 10 11  skewhypFit(x, freq = NULL, breaks = NULL, startValues = "LA",
paramStart = NULL, method = "NelderMead", hessian = TRUE,
plots = FALSE, printOut = TRUE, controlBFGS = list(maxit = 200),
controlNM = list(maxit = 1000), maxitNLM = 1500, ...)
## S3 method for class 'skewhypFit'
plot(x, which = 1:4,
plotTitles = paste(c("Histogram of ", "LogHistogram of ",
"QQ Plot of ", "PP Plot of "), x$obsName, sep = ""),
ask = prod(par("mfcol")) < length(which) && dev.interactive(), ...)
## S3 method for class 'skewhypFit'
print(x,digits = max(3, getOption("digits")  3),...)

Arguments
x 
Data vector for 
freq 
Vector of weights with length equal to length of 
breaks 
Breaks for histogram, defaults to those generated by

startValues 
Code giving the method of determining starting values for finding the maximum likelihood estimates of the parameters. 
paramStart 
If 
method 
Different optimisation methods to consider, see Details. 
hessian 
Logical; if 
plots 
Logical; if 
printOut 
Logical; if 
controlBFGS 
A list of control parameters for 
controlNM 
A list of control parameters for 
maxitNLM 
A positive integer specifying the maximum number of
iterations when using the 
which 
If a subset of plots is required, specify a subset of the
numbers 
plotTitles 
Titles to appear above the plots. 
ask 
Logical; if 
digits 
Desired number of digits when the object is printed. 
... 
Passes arguments to 
Details
startValues
can be either "US"
(Usersupplied) or
"LA"
(Linear approximation)
If startValues = "US"
then a value for paramStart
must be
supplied. For the details concerning the use of startValues
and paramStart
see skewhypFitStart
.
The three optimisation methods currently available are:
"BFGS"
Uses the quasiNewton method"BFGS"
as documented inoptim
."NelderMead"
Uses an implementation of the Nelder and Mead method as documented inoptim
."nlm"
Uses thenlm
function in R.
For the details of how to pass control information using
optim
and nlm
, see optim
and
nlm.
Value
skewhypFit
returns a list with components:
param 
A vector giving the maximum likelihood estimates of the
parameters in the form 
maxLik 
The value of the maximised loglikelihood. 
hessian 
If 
method 
Optimisation method used. 
conv 
Convergence code. See 
iter 
Number of iterations of optimisation routine. 
x 
The data used to fit the distribution. 
xName 
Character string with the actual 
paramStart 
Starting values of the parameters returned by

svName 
Name of the method used to find starting values. 
startValues 
Acronym of method used to find starting values. 
breaks 
Cell boundaries found by a call to 
midpoints 
The cell midpoints found by a call to

empDens 
The estimated density found by a call to

Author(s)
David Scott d.scott@auckland.ac.nz, Fiona Grimson
References
Aas, K. and Haff, I. H. (2006). The Generalised Hyperbolic Skew Student's tdistribution, Journal of Financial Econometrics, 4, 275–309.
See Also
optim
, nlm
, par
,
hist
, density,
logHist
,
qqskewhyp
, ppskewhyp
,
dskewhyp
and skewhypFitStart
.
Examples
1 2 3 4 5 6 7 8 9 10  ## See how well skewhypFit works
param < c(0, 1, 4, 10)
data < rskewhyp(500, param = param)
fit < skewhypFit(data)
## Use data set NOK/EUR as per Aas&Haff
data(lrnokeur)
nkfit < skewhypFit(lrnokeur, method = "nlm")
## Use data set DJI
data(lrdji)
djfit < skewhypFit(lrdji)
