Estimates parameters of the generalised lambda
distribution on the basis of data, using the starship method.
The starship method is built on the fact that the
generalised lambda distribution (gld
)
is a transformation of the uniform distribution. This method finds the
parameters that transform the data closest to the uniform distribution.
This function uses a grid-based search to find a suitable starting point (using
starship.adaptivegrid
) then uses optim
to find
the parameters that do this.
starship(data, optim.method = "Nelder-Mead", initgrid = NULL,
inverse.eps = .Machine$double.eps, param="FMKL", optim.control=NULL, return.data=FALSE)
starship
returns an object of class
"starship"
.
print
prints the estimated values of the parameters, while
summary.starship
prints these by default, but can also provide
details of the estimation process (from the components grid.results
and
optim
detailed below).
An object of class "starship"
is a list containing at least the
following components:
A vector of length 4 (or 5, for the fm5 parameterisation), giving
the estimated parameters, in order,
\(\lambda_1\) - location parameter
\(\lambda_2\) - scale parameter
\(\lambda_3\) - first shape parameter
\(\lambda_4\) - second shape parameter
(See gld
for details of the parameters in the fm5 parameterisation)
In the gpd parameterisation, the parameters are labelled: \(\alpha\) - location parameter \(\beta\) - scale parameter \(\delta\) - skewness parameter \(\lambda\) - tailweight parameter
output from the grid search - see
starship.adaptivegrid
for details
output from the optim search -
optim
for details
Data to be fitted, as a vector
Optimisation method for optim
to use,
defaults to Nelder-Mead
Grid of values of \(\lambda_3\) and
\(\lambda_4\)
to try, in starship.adaptivegrid
. This should be a list with
elements,
lcvect
, a vector of values for \(\lambda_3\),
ldvect
, a vector of values for \(\lambda_4\) and
levect
, a vector of values for \(\lambda_5\)
(levect
is only required if param
is fm5
).
If it is left as NULL, the default grid depends on the parameterisation.
For fmkl
, both lcvect and ldvect default to:
-1.5 | -1 | -0.5 | -0.1 | 0 | 0.1 | 0.2 | 0.4 | 0.8 | 1 | 1.5 |
(levect
is NULL).
For rs
, both lcvect and ldvect default to:
0.1 | 0.2 | 0.4 | 0.8 | 1 | 1.5 |
(levect
is NULL). Note that this restricts the estimates to only part of the region
of the \(\lambda_3\), \(\lambda_4\) plane.
For gpd
, the defaults are: \(\delta\):
0.3 | 0.5 | 0.7 |
and \(\lambda\):
-1.5 | -.5 | 0 | .2 | .4 | 0.8 | 1.5 | 5 |
For fm5
, both lcvect and ldvect default to:
-1.5 | -1 | -.5 | -0.1 | 0 | 0.1 | 0.2 | 0.4 | 0.8 | 1 | 1.5 |
and levect
defaults to:
-0.5 | 0.25 | 0 | 0.25 | 0.5 |
Accuracy of calculation for the numerical determination of
\(F(x)\), defaults to .Machine$double.eps
choose parameterisation:
fmkl
uses Freimer, Mudholkar, Kollia and Lin (1988) (default).
rs
uses Ramberg and Schmeiser (1974)
fm5
uses the 5 parameter version of the FMKL parameterisation
(paper to appear)
List of options for the optimisation step. See
optim
for details. If left as NULL, the parscale
control is set to scale \(\lambda_1\)
and \(\lambda_2\) by the absolute value of their starting points.
Logical: Should the function return the data (from the argument data
)?
Robert King, robert.king.newcastle@gmail.com, https://github.com/newystats/
Darren Wraith
The starship method is described in King & MacGillivray, 1999 (see
references). It is built on the fact that the
generalised lambda distribution (gld
)
is a transformation of the uniform distribution. Thus the inverse of this
transformation is the distribution function for the gld. The starship method
applies different values of the parameters of the distribution to the
distribution function, calculates the depths q corresponding to the data
and chooses the parameters that make the depths closest to a uniform
distribution.
The closeness to the uniform is assessed by calculating the Anderson-Darling
goodness-of-fit test on the transformed data against the uniform, for a
sample of size length(data)
.
This is implemented in 2 stages in this function. First a grid search is
carried out, over a small number of possible parameter values
(see starship.adaptivegrid
for details). Then the minimum from
this search is given as a starting point for an optimisation of the
Anderson-Darling value using optim, with method given by optim.method
See GeneralisedLambdaDistribution
for details on
parameterisations.
Freimer, M., Mudholkar, G. S., Kollia, G. & Lin, C. T. (1988), A study of the generalized tukey lambda family, Communications in Statistics - Theory and Methods 17, 3547--3567.
Ramberg, J. S. & Schmeiser, B. W. (1974), An approximate method for generating asymmetric random variables, Communications of the ACM 17, 78--82.
King, R.A.R. & MacGillivray, H. L. (1999), A starship method for fitting the generalised \(\lambda\) distributions, Australian and New Zealand Journal of Statistics 41, 353--374
Owen, D. B. (1988), The starship, Communications in Statistics - Computation and Simulation 17, 315--323.
starship.adaptivegrid
,
starship.obj
exampledata <- rgl(300,c(0,1,0.2,0))
starship(exampledata)
Run the code above in your browser using DataLab