Density, density quantile, distribution function, quantile
function and random generation for the generalised lambda distribution
(also known as the asymmetric lambda, or Tukey lambda). Provides for four
different parameterisations, the fmkl
(recommended), the rs
, the gpd
and
a five parameter version of the FMKL, the fm5
.
dgl(x, lambda1 = 0, lambda2 = NULL, lambda3 = NULL, lambda4 = NULL,
param = "fkml", lambda5 = NULL, inverse.eps = .Machine$double.eps,
max.iterations = 500)
dqgl(p, lambda1, lambda2 = NULL, lambda3 = NULL, lambda4 = NULL,
param = "fkml", lambda5 = NULL)
pgl(q, lambda1 = 0, lambda2 = NULL, lambda3 = NULL, lambda4 = NULL,
param = "fkml", lambda5 = NULL, inverse.eps = .Machine$double.eps,
max.iterations = 500)
qgl(p, lambda1, lambda2 = NULL, lambda3 = NULL, lambda4 = NULL,
param = "fkml", lambda5 = NULL)
rgl(n, lambda1=0, lambda2 = NULL, lambda3 = NULL, lambda4 = NULL,
param = "fkml", lambda5 = NULL)
dgl
gives the density (based on the quantile density and a
numerical solution to \(F^{-1}(u)=x\)),
qdgl
gives the quantile density,
pgl
gives the distribution function (based on a numerical
solution to \(F^{-1}(u)=x\)),
qgl
gives the quantile function, and
rgl
generates random deviates.
vector of quantiles.
vector of probabilities.
number of observations.
This can be either a single numeric value or a vector.
If it is a vector, it must be of length 4 for parameterisations
fmkl
, rs
and gpd
and of length 5 for parameterisation fm5
.
If it is a vector, it gives all the parameters of the generalised lambda
distribution (see below for details) and the other lambda
arguments
must be left as NULL.
If it is a a single value, it is \(\lambda_1\), the location
parameter of the distribution (\(\alpha\) for the gpd
parameterisation). The other parameters are given by the
following arguments
Note that the numbering of the \(\lambda\) parameters for
the fmkl
parameterisation is different to that used by Freimer,
Mudholkar, Kollia and Lin. Note also that in the gpd
parameterisation, the four parameters are labelled \(\alpha, \beta, \delta, \lambda\).
\(\lambda_2\) - scale parameter (\(\beta\) for gpd
)
\(\lambda_3\) - first shape parameter (\(\delta\), a skewness parameter for gpd
)
\(\lambda_4\) - second shape parameter (\(\lambda\), a tail-shape parameter for gpd
)
\(\lambda_5\) - a skewing parameter, in the fm5 parameterisation
choose parameterisation (see below for details)
fmkl
uses Freimer, Mudholkar, Kollia and Lin (1988) (default).
rs
uses Ramberg and Schmeiser (1974)
gpd
uses GPD parameterisation, see van Staden and Loots (2009)
fm5
uses the 5 parameter version of the FMKL parameterisation
(paper to appear)
Accuracy of calculation for the numerical determination of
\(F(x)\), defaults to .Machine$double.eps
. You may wish to make
this a larger number to speed things up for large samples.
Maximum number of iterations in the numerical determination of \(F(x)\), defaults to 500
Robert King, robert.king.newcastle@gmail.com, https://github.com/newystats/
The generalised lambda distribution, also known as the asymmetric lambda,
or Tukey lambda distribution, is a distribution with a wide range of shapes.
The distribution is defined by its quantile function (Q(u)), the inverse of the
distribution function. The gld
package implements three parameterisations of the distribution.
The default parameterisation (the FMKL) is that due to Freimer
Mudholkar, Kollia and Lin (1988) (see references below), with a quantile
function:
$$Q(u)= \lambda_1 + { { \frac{u^{\lambda_3}-1}{\lambda_3} - %
\frac{(1-u)^{\lambda_4}-1}{\lambda_4} } \over \lambda_2 } %
$$
for \(\lambda_2 > 0\).
A second parameterisation, the RS, chosen by setting param="rs"
is
that due to Ramberg and Schmeiser (1974), with the quantile function:
$$Q(u)= \lambda_1 + \frac{u^{\lambda_3} - (1-u)^{\lambda_4}} %
{\lambda_2} $$
This parameterisation has a complex series of rules determining which values of the parameters produce valid statistical distributions. See gl.check.lambda for details.
Another parameterisation, the GPD, chosen by setting param="gpd"
is
due to van Staden and Loots (2009), with a quantile function:
$$Q(u) = \alpha + \beta ((1-\delta)\frac{(u^\lambda -1)}{\lambda} - \delta\frac{((1-u)^\lambda -1)}{\lambda} )$$
for \(\beta > 0\)
and \(-1 \leq \delta \leq 1\).
(where the parameters appear in the par
argument to the function in the order \(\alpha,\beta,\delta,\lambda\)). This parameterisation has simpler
L-moments than other parameterisations and \(\delta\) is a skewness parameter
and \(\lambda\) is a tailweight parameter.
Another parameterisation, the FM5, chosen by setting param="fm5"
adds an additional skewing parameter to the FMKL parameterisation.
This uses the same approach as that used by
Gilchrist (2000)
for the RS parameterisation. The quantile function is
$$F^{-1}(u)= \lambda_1 + { { \frac{(1-\lambda_5)(u^{\lambda_3}-1)}%
{\lambda_3} - \frac{(1+\lambda_5)((1-u)^{\lambda_4}-1)}{\lambda_4} } %
\over \lambda_2 }$$
for \(\lambda_2 > 0\)
and \(-1 \leq \lambda_5 \leq 1\).
The distribution is defined by its quantile function and its distribution and
density functions do not exist in closed form. Accordingly, the results
from pgl
and dgl
are the result of numerical solutions to the
quantile function, using the Newton-Raphson method. Since the density
quantile function, \(f(F^{-1}(u))\), does exist, an additional
function, dqgl
, computes this.
The functions qdgl.fmkl
, qdgl.rs
, qdgl.fm5
,
qgl.fmkl
, qgl.rs
and qgl.fm5
from versions 1.5 and
earlier of the gld
package have been renamed (and hidden) to .qdgl.fmkl
,
.qdgl.rs
, ..qdgl.fm5
, .qgl.fmkl
, .qgl.rs
and .qgl.fm5
respectively. See the code for more details
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.
Gilchrist, Warren G. (2000), Statistical Modelling with Quantile Functions, Chapman and Hall
Karian, Z.A., Dudewicz, E.J., and McDonald, P. (1996), The extended generalized lambda distribution system for fitting distributions to data: history, completion of theory, tables, applications, the ``Final Word'' on Moment fi ts, Communications in Statistics - Simulation and Computation 25, 611--642.
Karian, Zaven A. and Dudewicz, Edward J. (2000), Fitting statistical distributions: the Generalized Lambda Distribution and Generalized Bootstrap methods, Chapman & Hall
Ramberg, J. S. & Schmeiser, B. W. (1974), An approximate method for generating asymmetric random variables, Communications of the ACM 17, 78--82.
Van Staden, Paul J., & M.T. Loots. (2009), Method of L-moment Estimation for the Generalized Lambda Distribution. In Proceedings of the Third Annual ASEARC Conference. Callaghan, NSW 2308 Australia: School of Mathematical and Physical Sciences, University of Newcastle.
qgl(seq(0,1,0.02),0,1,0.123,-4.3)
pgl(seq(-2,2,0.2),0,1,-.1,-.2,param="fmkl")
Run the code above in your browser using DataLab