Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

GLDfunctions

The Generalised Lambda Distribution Family


Description

Density, quantile density, distribution function, quantile function and random generation for the generalised lambda distribution (also known as the asymmetric lambda, or Tukey lambda). Works for both the "fmkl" and "rs" parameterisations. These functions originate from the gld library by Robert King and they are modified in this package to allow greater functionality and adaptability to new fitting methods. It does not give an error message for invalid distributions but will return NAs instead. To allow comparability with the pkg(gld) package, this package uses the same notation and description as those written by Robert King.

Usage

dgl(x, lambda1 = 0, lambda2 = NULL, lambda3 = NULL, lambda4 = NULL, 
       param = "fmkl", inverse.eps = 1e-08, 
       max.iterations = 500)
     pgl(q, lambda1 = 0, lambda2 = NULL, lambda3 = NULL, lambda4 = NULL, 
       param = "fmkl",  inverse.eps = 1e-08, 
       max.iterations = 500)
     qgl(p, lambda1, lambda2 = NULL, lambda3 = NULL, lambda4 = NULL,
       param = "fmkl")
     rgl(n, lambda1=0, lambda2 = NULL, lambda3 = NULL, lambda4 = NULL,
       param = "fmkl")

Arguments

x

Vector of actual values for dgl

p

Vector of probabilities for qgl or qdgl

q

Vector of quantiles for pgl

n

Number of observations to be generated for rgl

lambda1

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" or "rs" and of length 5 for parameterisation "fm5" and the other 'lambda' arguments must be left as NULL. The numbering of the lambda parameters for the "fmkl" parameterisation is different to that used by Freimer, Mudholkar, Kollia and Lin (1988).

lambda2

Scale parameter

lambda3

First shape parameter

lambda4

Second shape parameter

param

"fmkl" or "fkml" uses Freimer, Kollia, Mudholkar, and Lin (1988) and it is the default setting. "rs" uses Ramberg and Schmeiser (1974)

inverse.eps

Accuracy of calculation for the numerical determination of F(x), defaults to 1e-8

max.iterations

Maximum number of iterations in the numerical determination of F(x), defaults to 500

Details

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, 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:

F inverse (u) = lambda1 + ( (u^lambda3 -1)/lambda3 - ((1-u)^lambda4-1) /lambda4 ) / lambda 2

for lambda2 >0.

A second parameterisation, the RS, chosen by setting param="rs" is that due to Ramberg and Schmeiser (1974), with the quantile function:

F inverse (u) = lambda1 + ( u^lambda3 - (1-u)^lambda4 ) / 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.

Value

dgl

gives the density (based on the quantile density and a numerical solution to F inv (u)=x,

qdgl

gives the quantile density,

pgl

gives the distribution function (based on a numerical solution to F inv (u)=x,

qgl

gives the quantile function, and

rgl

generates random observations.

References

Freimer, M., Kollia, G., Mudholkar, G. S. & 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 & 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 fits, 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.

Examples

qgl(seq(0,1,0.02),0,1,0.123,-4.3)
 pgl(seq(-2,2,0.2),0,1,-.1,-.2,param="fmkl",inverse.eps=.Machine$double.eps)

GLDEX

Fitting Single and Mixture of Generalised Lambda Distributions (RS and FMKL) using Various Methods

v2.0.0.7
GPL (>= 3)
Authors
Steve Su, with contributions from: Diethelm Wuertz, Martin Maechler and Rmetrics core team members for low discrepancy algorithm, Juha Karvanen for L moments codes, Robert King for gld C codes and starship codes, Benjamin Dean for corrections and input in ks.gof code and R core team for histsu function.
Initial release
2020-02-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.